[ 
https://issues.apache.org/jira/browse/TRINIDAD-1319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12650244#action_12650244
 ] 

Andrew Robinson commented on TRINIDAD-1319:
-------------------------------------------

tr:forEach and c:forEach are the same (after JSTL 1.2). Now facelets c:forEach 
is not the same as JSTL c:forEach, there are some behavioral differences. 

Either way, the problem is not with JSTL and JSF, but how you are using them. 
That is why I recommended that you read about how the dataTable works. I also 
wrote this blog about JSTL & JSF:

http://andrewfacelets.blogspot.com/2008/03/build-time-vs-render-time.html

You need to understand the differences between when the JSF components are 
processed vs. when JSP tags execute. The XML/JSP file makes it appear that they 
are all ubiquitous when they are not. JSP tags execute to build the JSF 
component tree, but the JSF components are not "running" at that time. Running 
means that there is an active JSF lifecycle where the component tree is being 
recursed. 

This means that the "var" in the dataTable, does not exists outside of the JSF 
lifecycle, but you are attempting to use this "var" in a JSTL tag, which is run 
when the component tree is being built. 

Keep this rule in mind: JSF components can rely on components built by JSF, but 
JSP can *never* use JSF components.


> c:forEach does not work within tr:table
> ---------------------------------------
>
>                 Key: TRINIDAD-1319
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1319
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Facelets
>    Affects Versions: 1.0.10-core
>         Environment: Facelets 1.1.14, Trinidad 1.0.10, Orchestra 1.3
>            Reporter: Tomas Havelka
>
> I found, that c:forEach tag from JSTL dos not work within some Trinidad 
> components. In code above, no items are listed using c:forEach tag in 
> tr:table component:
>       <tr:table rowBandingInterval="1" value="#{oxViewController.model}" 
> var="app" width="100%">
>         <tr:column headerText="Code" sortable="true" sortProperty="code" 
> width="35%">
>           <tr:outputText value="#{app.code}"/>
>         </tr:column>
>         <tr:column headerText="Name" sortable="true" sortProperty="name">
>           <tr:outputText value="#{app.name}"/>
>         </tr:column>
>         <f:facet name="detailStamp">
>           <tr:panelList>
>             <c:forEach items="#{app.properties}" var="property">
>               <tr:outputText value="#{property.name}" 
> shortDesc="#{property.description}"/>
>               <tr:outputText value=" [required]" inlineStyle="color:red" 
> rendered="#{property.required}"/>
>             </c:forEach>
>           </tr:panelList>
>         </f:facet>
>       </tr:table>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to