]
Brian Leathem updated RF-12232:
-------------------------------
Fix Version/s: 4.3.0.Milestone1
[CDK] Support "varStatus" attribute on c:forEach
------------------------------------------------
Key: RF-12232
URL:
https://issues.jboss.org/browse/RF-12232
Project: RichFaces
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: cdk
Affects Versions: 4.2.1.Final
Environment: All
Reporter: Paul Dijou
Labels: cdk, richfaces
Fix For: 4.3.0.Milestone1
Right now, when using {{<c:forEach>}} tag on a CDK template.xml, you will have a
"for" loop in Java code. There is no way to do simple logic in the template like
knowing your current index inside the loop, etc...
An idea would be to support the {{varStatus}} attribute from the original
{{<c:forEach>}}. This attribute maps to the name of a bean which contains util
methods and evolve at each iteration of the loop.
Here is a sample:
{code:xml}
<c:forEach var="child" items="#{component.getChildren()}"
varStatus="status">
// Inside code
</c:forEach>
{code}
Would generate something like:
{code:java}
LoopTagStatus status = new LoopTagStatus();
for(UIComponent child : component.getChildren()) {
// Inside code
status.next();
}
{code}
The javadoc of the original {{LoopTagStatus}} from JSTL is
[
here|http://docs.oracle.com/javaee/5/jstl/1.1/docs/api/javax/servlet/jsp/...].
Our LoopTagStatus would have the method and one more : the {{next()}} method. This one
would increment the current index of the LoopTagStatus in order to be updated for the next
iteration.
We could also add any other usefull methods to this bean.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: