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

Listbox renders extras blank listitems after adding more data

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 9.0.1.2
    • 9.0.1
    • None
    • Security Level: Jimmy
    • None

      Steps to Reproduce

      1. run the attached zul

      <zk xmlns:h="native">
      	<zscript><![CDATA[
      	ListModelList model = new ListModelList(Locale.getAvailableLocales());
      	model = model.subList(0, 10);
      ]]></zscript>
      	<listbox width="400px" rows="10" model="${model}">
      <!--	<listbox width="400px" height="300px" model="${model}"> workaround -->
      		<listhead>
      			<listheader label="index" />
      			<listheader label="locale" />
      		</listhead>
      		<template name="model">
      			<listitem>
      				<listcell label="${forEachStatus.index}" />
      				<listcell label="${each}" />
      			</listitem>
      		</template>
      	</listbox>
      	<button label="add 10 to invalidate" onClick="add10()"/>
      	<zscript><![CDATA[
      public void add10(){
      	List list = new LinkedList();
      	for (int i = 0 ; i < 15 ; i++){
      		list.add(Locale.TAIWAN);
      	}
      	model.addAll(list);
      }
      	]]></zscript>
      </zk>
      
      

      Current Result


      it renders several unexpected list items

      Expected Result

      no those extra list items

      Debug Information

      • 9.0.0 doesn't have such issue

      Workaround

      use height instead of rows

            Unassigned Unassigned
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: