-
1. Re: <a4j:repeat> doesn’t work inside of <rich:dataTable>
mcmurdosound Apr 11, 2013 4:41 PM (in response to zont)this won't work as far as I know, because the "row" variable isn't available at buildtime. (so it cannot be used with c:forEach either)
Can #{row.values} change per row? Then you would have a different number of colums per row. This makes no sense ;-)
What you can do:
<rich:dataTable value="..." var="row" >
...
<c:forEach items="#{mybean.availableColsForThisDataModel}" var="col">
<rich:column>
<h:outputText value="#{row[col]}"/>
</rich:column>
</c:forEach>
here mybean.availableColsForThisDataModel must be independet from the datatables "var" attribute since this would not be available on buildtime.
to access the actual value for each of these dynamic generated columns, you can use some map-notation:
#{row[col]}
not sure when to initialize this availableColsForDataModel stuff. Probably in the @Create annotated method of the bean. Not trivial. There might be a simpler solution for this. ;-)
private List<String> availableColsForDataModel;
public List<String> getAvailableColsForDataModel(){...}
@Create
public void init(){
availableColsForDataModel = new ArrayList<String>();.... add all properties of your datamodel as String to this list.
}
this should work with seam 2.2, jsf 1.2 and rf 3.3.3
-
2. Re: <a4j:repeat> doesn’t work inside of <rich:dataTable>
zont Apr 12, 2013 12:39 PM (in response to mcmurdosound)Thank you Christian.
No, row.values can't change per row, the length of all rows is equal.
What do you mean with buildtime, which phase of the jsf life cycle do you mean?
I don't understand why the first column is printed out, the row.features.value is available but the row.values inside of repeat is not