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

sh:forEach insert item at wrong position

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.0.0
    • Fix Version/s: 8.0.0
    • Component/s: Databind 2
    • Security Level: Jimmy

      Description

      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>
      

        Issue Links

          Activity

          cor3000 cor3000 created issue -
          jumperchen jumperchen made changes -
          Field Original Value New Value
          issue.field.resolutiondate 2015-06-17 05:16:48.0 2015-06-17 05:16:48.427
          Remaining Estimate 0 minutes [ 0 ]
          Time Spent 2 hours [ 7200 ]
          Worklog Id 13200 [ 13200 ]
          jumperchen jumperchen made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Assignee jumperchen [ jumperchen ]
          Fix Version/s 8.0.0 [ 12610 ]
          Resolution Fixed [ 1 ]
          cor3000 cor3000 made changes -
          Link This issue relates to ZK-2799 [ ZK-2799 ]
          cor3000 cor3000 made changes -
          Link This issue relates to ZK-2800 [ ZK-2800 ]
          rudyhuang rudyhuang made changes -
          Workflow zk [ 20736 ] ZK CodeReview Workflow [ 26668 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

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