struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fergunet <fergu...@hotmail.com>
Subject How to list a property in a display:table (Struts 2)
Date Wed, 08 Aug 2007 12:31:41 GMT

Hi all!

I've created a display table to show a list of things and their attributes.
But one of those attributes is another list of objects. I don't know how to
print their names.

Let's see what I have:


<display:table name="usersBase" class="displaytag" pagesize="10"
defaultsort="1" 
                       defaultorder="ascending" export="true" id="row"
requestURI="/user/list.mpch" >
            <display:caption title="global.users"/>
            <display:column property="id" titleKey="global.id"
sortable="true" headerClass="sortable"/>
            <display:column property="login" titleKey="global.login"
sortable="true" headerClass="sortable"/>
            <display:column property="name" titleKey="global.name"
sortable="true" headerClass="sortable"/>
            <display:column property="cif" titleKey="global.cif"
sortable="true" headerClass="sortable"/>
            <display:column property="email" titleKey="global.email"
sortable="true" headerClass="sortable"/>
            <display:column property="roles" titleKey="global.roles"
sortable="true" headerClass="sortable"/>
            
            <display:column title="Roles">
                <s:iterator value="${row.roles}">
                    ITERATE!!!!
                </s:iterator>
                
                
            </display:column>
            <display:column title="getTextglobal.provider" sortable="true"
headerClass="sortable">
                <s:if test="${row.provider}==true">
                    Is provider                    
                </s:if>
                <s:else>
                    Is not provider
                </s:else>
</display:table>


Look at the "roles" property column. That property is a List<RoleVO> which
have an attribute RoleBaseVO wich have the String "name". I'm trying to show
the list of that names. (Now only prints:
[org.myapp.common.isc.model.users.RoleVO@d53d82,
org.myapp.common.isc.model.users.RoleVO@1b939d3,
org.myapp.common.isc.model.users.RoleVO@1836525] )

I thought to use an iterator as you can see, but the "ITERATE!!!" string is
never shown.

Any ideas? Thanks in advance, and sorry about my English.
-- 
View this message in context: http://www.nabble.com/How-to-list-a-property-in-a-display%3Atable-%28Struts-2%29-tf4236011.html#a12052184
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message