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

Chosenbox with ListModel issue

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 6.5.1, 6.0.4
    • Fix Version/s: 6.5.2, 6.0.5
    • Component/s: Components
    • Security Level: Jimmy

      Description

      When using ListModelList<String> in chosenbox, everything is fine. But if using ListModelList<Bean>, the input value will clear after click test button.

      <zk>
      <zscript><![CDATA[
      import java.util.*;
      import org.zkoss.zul.*;
      public class Shop {
      	private Integer id;
      	private String nameShop;
      	
      	public Shop(Integer id, String nameShop) {
      		this.id = id;
      		this.nameShop = nameShop;
      	}
      	public Integer getId() {
      		return id;
      	}
      	public String getNameShop() {
      		return nameShop;
      	}
      	public String toString() {
      		return nameShop;
      	}
      }
      List listShop = new ArrayList();
      for (int i = 0; i < 100; i++)
      	listShop.add(new Shop(i, "SHOP - " + i));
      
      ListModelList model = new ListModelList(listShop);
      ]]></zscript>
      	<window title="Chosen Box" border="normal">
      		<chosenbox id="cb" model="${model}" width="400px" noResultsText="No such item - {0}" />
      		<button label="test" onClick="alert(cb.getSelectedObjects())" />
      	</window>
      </zk>
      

        Attachments

          Activity

            People

            Assignee:
            vincentjian vincentjian
            Reporter:
            vincentjian vincentjian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: