How to use foreach in jsf?

0 like 0 dislike
5 views
Good afternoon.
There was such problem: from the database I get a string of comma separated words. In the entity (entity) links with communication one-to-many, therefore, to use the DTO pattern - does not work (or I just don't understand how).
When output to the page, I have each word display as a separate link. the roof is already going but the result is still no: - tried to convert to use a separate bin
@Stateless @ManagedBean(name = "dtFileHelper") public class FileHelper { public List myName(String name) { String[] oneName; List rez1=new ArrayList<>(); oneName = name.split(","); for (String nam:oneName) { rez1.add(nam); } return rez1; } }

And the conclusion:


But damn, it displays only the first record. Although the list rez1 - returns correct.
If you rewrite the bin to just when creating a list filled with fixed values then everything is fine - displays these values.
in what direction to dig? I understand that the debug xhtml files, no?
by | 5 views

1 Answer

0 like 0 dislike
In General, it turned out that the problem lies a little in other - the initially filled datagrid in lazy style, you had to use ui:repeat and it worked.
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
6 answers
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
asked May 20, 2019 by SlandShow
110,608 questions
257,186 answers
0 comments
33,949 users