Does the <ui:repeat />
tag support iterating over a java.util.Set
? I've tried iterating over my JPA domain entity objects contained in a Set, but receive errors. Is there something I'm missing? Does an additional flag need to be present or something?
views:
37answers:
2
+2
A:
Consider using c:forEach
instead. It appears that ui:repeat
does not support sets (i.e. requires some sort of ordering property).
Otherwise you can create your own tag as described in: http://techblog.bozho.net/?p=28
AdamH
2010-10-25 18:30:54
+1 for the site link.
Harry Pham
2010-10-25 18:36:20
Do **NOT** consider using `c:forEach`: http://www.ilikespam.com/blog/c:foreach-vs-ui:repeat-in-facelets
Shervin
2010-10-25 18:54:13
It completely depends on what the set is that you are iterating over and if it compile time or not. So if that is the case then you CAN use `c:forEach`.
AdamH
2010-10-25 18:57:24
Yes if you know what you are doing, then you can use `c:forEach`, but I read your post as that `you should consider using c:forEach`, and this is not the case. Better using `ui:repeat` to avoid problems
Shervin
2010-10-25 19:01:04