Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

How to list a property in a display:table (Struts 2)

fergunet

2007-08-08

Replies:


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@(protected),
org.myapp.common.isc.model.users.RoleVO@(protected),
org.myapp.common.isc.model.users.RoleVO@(protected)] )

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.
--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.