[richfaces-issues] [JBoss JIRA] (RF-12296) Improve CDK c:forEach typing

Paul Dijou (JIRA) jira-events at lists.jboss.org
Wed May 30 04:55:17 EDT 2012


Paul Dijou created RF-12296:
-------------------------------

             Summary: Improve CDK c:forEach typing
                 Key: RF-12296
                 URL: https://issues.jboss.org/browse/RF-12296
             Project: RichFaces
          Issue Type: Feature Request
      Security Level: Public (Everyone can see)
          Components: cdk
    Affects Versions: 4.2.2.Final
         Environment: All
            Reporter: Paul Dijou


As we can see on [this comment|https://issues.jboss.org/browse/RF-10037?focusedCommentId=12696717&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12696717], you currently need to assign a list/array to a var before using it inside a {{<c:forEach>}} or the CDK doesn't know its correct type.

As suggested by Lukas, I agree to add a {{cdk:itemType}} (or {{cdk:type}} like in the {{<cdk:object>}} tag) to specify manually the type of the object inside the iteration. If this attribute is present in the {{<c:forEach>}}, then the CDK use it to cast the object, otherwise it does the same as currently, no regression.

In addition, for Enum, I would also try to use the initial import :

{code:xml}
<cdk:import package="org.richfaces.component" names="MyEnum" />
{code}

In order to know the type of each Enum and then be able to correctly cast the following code :

{code:xml}
<cc:implementation>
    <c:forEach items="#{MyEnum.values()}" var="item">
        #{item}
    </c:forEach>
</cc:implementation>
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list