forEachStatus"

From Documentation
m
(ForEachStatus.getEach() removed in 10.0.0)
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{ZUMLReferencePageHeader}}
 
{{ZUMLReferencePageHeader}}
  
== forEachStatus – org.zkoss.zk.ui.util.ForEachStatus ==
+
= forEachStatus – <javadoc type="interface">org.zkoss.zk.ui.util.ForEachStatus</javadoc> =
The status of an iteration. ZK exposes the information relative to the iteration taking place when evaluating the iterative element.
+
The status of an iteration. It is an instance of <javadoc type="interface">org.zkoss.zk.ui.util.ForEachStatus</javadoc>. ZK exposes the information relative to the iteration taking place when evaluating the iterative element.
  
 
<source lang="xml" >
 
<source lang="xml" >
<zk>
+
<listbox width="100px">
  <zscript>
+
    <listitem label="${forEachStatus.index}: ${each}" forEach="Best, Better, Good"/>
grades = new String[] {"Best", "Better", "Good"};
+
</listbox>
  </zscript>
 
  <listbox width="100px">
 
    <listitem label="${forEachStatus.index}: ${each}" forEach="${grades}"/>
 
  </listbox>
 
</zk>
 
 
</source>
 
</source>
 
   
 
   
Note: <tt>forEachStatus.index</tt> is absolute with respect to the underlying collection, array or other type. For example, if <tt>forEachBegin</tt> is <tt>5</tt>, then the first value of <tt>forEachStatus.index</tt> with be <tt>5</tt>.
+
Note: <code>forEachStatus.index</code> is absolute with respect to the underlying collection, array or other type. For example, if <code>forEachBegin</code> is <code>5</code>, then the first value of <code>forEachStatus.index</code> will be <code>5</code>.
  
==Version History==
+
To retrieve the information of the outer iterator if an iteration is nested, you could use <javadoc method="getPrevious()" type="interface">org.zkoss.zk.ui.util.ForEachStatus</javadoc>.
 +
 
 +
<source lang="xml">
 +
<listbox forEach="${matrix}">
 +
    <listitem label="${forEachStatus.previous.each.label}: ${each}" forEach=${each.items}/> <!-- nested-->
 +
</listbox>
 +
</source>
 +
 
 +
<javadoc method="getEach()" type="interface">org.zkoss.zk.ui.util.ForEachStatus</javadoc> has been{{deprecatedSince | 8.0.0}} and removed{{versionSince | 10.0.0}}, please use <javadoc method="getCurrent()" type="interface">org.zkoss.zk.ui.util.ForEachStatus</javadoc> instead. For example, replace <code>${forEachStatus.previous.each.label}</code> with <code>${forEachStatus.previous.current.label}</code>.
 +
 
 +
=Version History=
  
 
{| border='1px' | width="100%"
 
{| border='1px' | width="100%"

Latest revision as of 10:25, 2 February 2024

forEachStatus – ForEachStatus

The status of an iteration. It is an instance of ForEachStatus. ZK exposes the information relative to the iteration taking place when evaluating the iterative element.

<listbox width="100px">
    <listitem label="${forEachStatus.index}: ${each}" forEach="Best, Better, Good"/>
</listbox>

Note: forEachStatus.index is absolute with respect to the underlying collection, array or other type. For example, if forEachBegin is 5, then the first value of forEachStatus.index will be 5.

To retrieve the information of the outer iterator if an iteration is nested, you could use ForEachStatus.getPrevious().

<listbox forEach="${matrix}">
    <listitem label="${forEachStatus.previous.each.label}: ${each}" forEach=${each.items}/> <!-- nested-->
</listbox>

ForEachStatus.getEach() has beenDeprecated Since 8.0.0 and removedSince 10.0.0, please use ForEachStatus.getCurrent() instead. For example, replace ${forEachStatus.previous.each.label} with ${forEachStatus.previous.current.label}.

Version History

Version Date Content
     



Last Update : 2024/02/02

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.