This content has been marked as final.
Show 2 replies
-
1. Re: c:foreach or rich:columns?
ilya_shaikovsky May 21, 2010 2:11 PM (in response to corte86)The rich:columns tag(the same for c:forEach) is initialized during components tree building process. This process precedes page rendering at
Render Response
JSF phase. So you can't use variable from dataTable VAR as value for the tags.As for repeat component - them should works fine in this case. Need more info on that.
-
2. Re: c:foreach or rich:columns?
corte86 May 25, 2010 9:37 AM (in response to corte86)Thankyou Ilya for your help...the problem (as i could understand) was that i was trying to specify to the rich columns tag a variable which haven't value during (as u say) the component tree building....so that the dynamic behavior of the tag was a bit "too dynamic"....the only "problem" was that it didn't show me an error, or an alert, nothing it was just rendering the empty table...maybe this should be fixed, or changed, cuz it was very hard to me to understand....maybe impossible if it wasn't for ur help....
Or maybe this can be better specified in the docs....something like: IN THE RICH:COLUMNS "VALUE" ATTRIBUTE, YOU MUST SPECIFY A VARIABLE THAT CAN BE _RESOLVED_ DURING TREE BUILDING PROCESS...otherwise, the rich columns cannot manage the "dinamicity" of the table and it doesn't show anything (empty table or the other "normal" column tag)...
this is how i fixed my error...i specified the number of columns by a query not based on the store, but based on another thing which could be resolved earlier, like a "constant" for the rendering phase of my page...
this is the code...(agreementEditor is a session bean who makes my lists and queries....palletList() is a query with no parameters which returns a FIXED lists of strings....
`
<rich:panel id="paneltable">
<rich:dataTable value="#{storesList}" var="stor" id="table">
<rich:column >
<f:facet name="header">
<h:outputText value="#{messages['store.name']}" />
</f:facet>
<h:outputText value="#{stor.name}"/>
</rich:column>
<rich:columns value="#{agreementEditor.palletList()}" var="pal" ind="ind">
<f:facet name="header">
<h:outputText value="#{pal}" />
</f:facet>
<h:outputText value="#{stor.pallet.amountValue}" />
</rich:columns>
</rich:dataTable>
</rich:panel>`
.hope i explain myself the right way, and that this could help anyone...maybe i made some 'theoric error' =D