Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1094

re-displaying modal window containing stubobly label throws js error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Normal Normal
    • None
    • 6.0.0, Freshly
    • Components
    • ZK 6

      Test case

      <zk>
      <zscript>
      <![CDATA[  //@IMPORT
      import org.zkoss.zk.ui.event.EventListener;
      ]]>
      <![CDATA[  //@DECLARATION
      
        Window win = null;
      
        public class MyListener implements EventListener{
         	public void onEvent(Event evt) throws Exception{
      
             if (win ==null)
             {	   
               win = new Window();
               win.setTitle("Hello!");
               win.setClosable(true);
      
      		 Label testLabel = new Label("My Label");
      		 testLabel.setStubonly("true");
               win.appendChild(testLabel);
             }
             win.setParent(evt.getTarget().getFellow("mainWindow"));
             win.doModal();
          }
       }
      ]]>
      </zscript>
      
      <window id="mainWindow">
      <button>Click me!
      	<attribute name="onCreate">
      		self.addEventListener("onClick", new MyListener(){});
      	</attribute>
      </button>
      </window>
      </zk>
      

      Steps to reproduce:
      1. Click on button. Modal window containing label is displayed
      2. Close the window
      3. Click on the button again to open window.
      Expected: Window with label is displayed correctly.
      Actual: JS error "Failed to mount stub XXXX" is shown

      Notice: it works fine on ZK 5.

            tomyeh tomyeh
            ashishd ashishd
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: