I have an ArrayList from a Bean :
...
public ArrayList<String[]> getArticleList() {
...
}
...
I need to print these values (with getter method) by using EL on JSF2 (such as #{bean.articlesLage}
How can I do this? Cheers
I don't remember if JSF supports arrays, however if you can convert your ArrayList<Array> to ArrayList<ArrayList<String>>, then something like this should work
<ui:repeat value="#{bean.articleList}" var="t">
<ui:repeat value="#{t}" var="s">
#{s}
</ui:repeat>
</ui:repeat>
ArrayList<String[]> has more String[]. If my first String[] in the arraylist is [hello, im, marco] and the second is [how, are, you] I would like to print values marco and you (which are at the 2° position for each String[].#{s} refers to the individual String item of String[]. The #{t} refers to individual String[] item of the List<String[]>. So you want to get rid of nested ui:repeat and use #{t[2]} instead.h:inputText inside ui:repeat? stackoverflow.com/questions/19395621You can use a nested ui:repeat or a nested datatable like this with your current model ArrayList :
<h:dataTable value="#{bean.articleList}" var="row">
<h:column>
<f:facet name="header">
<h:outputText value="COL" />
</f:facet>
<h:dataTable value="#{row}" var="nested_row">
<h:column>
<f:facet name="header">
<h:outputText value="COL" />
</f:facet>
<h:outputText value="#{nested_row}" />
</h:column>
</h:dataTable>
</h:column>
</h:dataTable>