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

rerendering of selectbox looses its data

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 6.0.0
    • Fix Version/s: None
    • Component/s: Components
    • Labels:

      Description

      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)
             {
               String[] userName = { "Tony", "Ryan", "Jumper", "Wing", "Sam" };
               ListModelList model = new ListModelList(userName);
               Selectbox selBox = new Selectbox();
               selBox.setModel(model);
      	 win = new Window();
               win.setTitle("Hello!");
               win.setClosable(true);
               win.appendChild(selBox);
             } 
             
             win.setParent(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
      Step 1: click on the button
      Step 2: check selectbox has data. Select some value. Close the window.
      Step 3: click on the button again. Window should be displayed. Check selectbox data.
      Expected: Selectbox data should be as initialized with.
      Actual: Selectbox data is missing.

        Attachments

          Activity

            People

            Assignee:
            benbai benbai
            Reporter:
            ashishd ashishd
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: