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

sh:forEach insert item at wrong position

XMLWordPrintable

      adding the value to the middle of the ListModelList will append the new item to the end when rendered.

      <zk xmlns:x="xhtml" xmlns:sh="shadow">
      	<zscript><![CDATA[
      		ListModelList model = new ListModelList();
      		model.add("1");
      		model.add("2");
      		model.add("3");
      		model.add("4");
      	]]></zscript>
      	<div id="bind" apply="org.zkoss.bind.BindComposer" >
      		<button label="insert" onClick='model.add(2, "2.5");'/>
      		<sh:forEach items="@load(model)" var="item">
      			<div>
      				<label value="@init(item)"/>
      			</div>
      		</sh:forEach>
      	</div>
      </zk>
      

            jumperchen jumperchen
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h