Results 1 to 3 of 3
- 05-20-2010, 05:04 PM #1
Member
- Join Date
- May 2010
- Posts
- 2
- Rep Power
- 0
JSF expression inside another JSF expression
Hello
I have a little problem. I have a list of maps List<Map<String,Waarde>>. For filling the maps I use a counter i, something like this:
To show the values on the screen I use a datatable, but to show the different objects Waarde in the maps, I need a counter in the name of the JSF expression, so a JSF expression inside another JSF expression, something like this:Java Code:Map m = new HashMap(); m.put("waarde"+[B]i[/B], Waarde); list.add(m);
Has someone an idea how to deal with this?XML Code:<h:dataTable value="#{list}" var="_map"> <a4j:repeat value="#{counter}" var="_i"> <h:column> <h:outputText value="#{_map.waarde#{_i}.tekst}" /> </h:column> </a4j:repeat> </h:dataTable>
Thanks a lot!
barbaraLast edited by barbarabxl; 05-20-2010 at 05:09 PM.
- 05-21-2010, 06:34 AM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
You don't need a counter to display values in the map.
Just loop through all the elements using the method entrySet which gives you all the entries.
You may need to create a getter style method in your backing bean so JSF can access it.
- 05-21-2010, 03:03 PM #3
Member
- Join Date
- May 2010
- Posts
- 2
- Rep Power
- 0
Thanks for your answer. I tried:
and the result was:Java Code:<h:dataTable value="#{waarden}" var="_map"> <h:column> <h:outputText value="size #{_map.size}" /> </h:column> <c:forEach items="#{_map.entrySet}" var="_mapje"> <h:column> <h:outputText value="test #{_mapje.value.tekst}" /> </h:column> </c:forEach> </h:dataTable>
size 5
size 5
size 5
So there is a loop through the list with the 3 maps in it, but he doesn't loop through the maps.
Similar Threads
-
regular expression
By prof.deedee in forum JDBCReplies: 3Last Post: 02-19-2010, 11:15 AM -
Quadratic Expression
By c3jcarmy in forum New To JavaReplies: 7Last Post: 11-28-2009, 06:16 PM -
regular expression
By ras_pari in forum Advanced JavaReplies: 27Last Post: 10-07-2009, 12:25 PM -
Quick reg. expression help
By RR_QQ in forum New To JavaReplies: 4Last Post: 02-10-2009, 07:51 PM -
Boolean Expression
By ritwik07 in forum New To JavaReplies: 3Last Post: 07-11-2007, 04:11 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks