This content has been marked as final.
Show 3 replies
-
1. Re: Getting outjected object's attributes
arussel Nov 25, 2007 6:42 AM (in response to ferd0)are you looking for: #{hotel.rooms.size()} ?
(using jboss el)
alex -
2. Re: Getting outjected object's attributes
ferd0 Nov 25, 2007 7:18 AM (in response to ferd0)Actually, I would like to do something like this:
<h:dataTable value="#{hotel.rooms}" var="room"> <h:column> <h:outputText value="#{room.number}" /> </h:column> </h:dataTable>
but it is not working.
The problem is, that if I would outject list "rooms", and use<h:dataTable value="#{rooms}" var="room">
it would work, but the version with "hotel.rooms" is not working.
I don't know if I'm using JBoss EL (I am using templates generated by seam-gen).
My environment: JBoss AS 4.0.5, JBoss Seam 1.2.1. -
3. Re: Getting outjected object's attributes
arussel Nov 25, 2007 8:02 AM (in response to ferd0)This defenitly works:
<h:dataTable value="#{hotel.rooms}" var="room"> <h:column> <h:outputText value="#{room.number}" /> </h:column> </h:dataTable>
If it is not working then you have a typo somewhere.
1. first check your getter/setter for rooms.
2. output #{hotel.rooms} to see if you got a list
3. use a datable as you did and just output #{room}
alex