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

Chosenbox with ListSubModel not working if using template to render data

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 6.5.4
    • Fix Version/s: 7.0.1, 6.5.6
    • Component/s: Components
    • Security Level: Jimmy
    • Labels:

      Description

      Sample code to reproduce:

      <zk>
      	<zscript><![CDATA[
      		public class Item {
      			private String name;
      		
      			public Item(String name) {
      				super();
      				this.name = name;
      			}
      		
      			public String getName() {
      				return name;
      			}
      		
      			public void setName(String name) {
      				this.name = name;
      			}
      		
      			public int hashCode() {
      				final int prime = 31;
      				int result = 1;
      				result = prime * result + ((name == null) ? 0 : name.hashCode());
      				return result;
      			}
      		
      			public boolean equals(Object obj) {
      				if (this == obj)
      					return true;
      				if (obj == null)
      					return false;
      				if (getClass() != obj.getClass())
      					return false;
      				Item other = (Item) obj;
      				if (name == null) {
      					if (other.name != null)
      						return false;
      				} else if (!name.equals(other.name))
      					return false;
      				return true;
      			}
      			
      			//public String toString() { return this.name; }
      		}
      		List l2 = Arrays.asList(new Item[]{
      				new Item("AA"), new Item("BB"), new Item("CC"), new Item("DD"), new Item("EE")});
                      ListModelList model1 = new ListModelList(l2);
      		ListSubModel smodel2 = ListModels.toListSubModel(new ListModelList(l2));
      	]]></zscript>
      	<label multiline="true">
      	Type A in the input, should see popup with "AA" option showed.
      	</label>
      	ListSubModel
      	<chosenbox id="box2" width="200px" model="${smodel2}" >
      		<template name="model">
      			<label value="${each.name}"/>
      		</template>
      	</chosenbox>
      </zk>
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: