Menu

Help - Struts - DisplayTag - Nested Tables

veejar75
2005-05-04
2012-10-09
  • veejar75

    veejar75 - 2005-05-04

    Hi,

    I'm using struts display tags to results in a tabular form, but I have a problem and need help using hte nested tables.

    Here's my example display table tag

    <display:table name="testForm" property="searchResults">
    <display:column property="parentName" title="Parent Name" />
    </display:table>

    I'm trying to print another table for each row of parent with a list of childs in it.
    Property search results is an list which displays a list of parents.
    And each Parent has a arraylist of childs in it.

    how can I do that???

    Thanks
    RK

     
    • Matt Raible

      Matt Raible - 2005-05-04

      The nested tables example might help:

      http://displaytag.homeip.net/example-nestedtables.jsp

      Matt

       
      • veejar75

        veejar75 - 2005-05-04

        Matt,

        I have tried that, but I couldn't figure out a way to refer to my Child arraylist.
        and also I get error message saying id attribute and class attribute are not supported.
        If possible can you desribe how I can use the nexted table with my example

        Thanks
        RK

         
        • Matt Raible

          Matt Raible - 2005-05-05

          Personally, I haven't used the nested table stuff, so I'd just be guessing if I did try to re-work your example.

          You could always use JSTL inside a 2nd column and do something like this:

          <display:table id="parent">
          <display:column property="name"/>
          <display:column>
          <c:forEach var="child" items="${parent.children}">
          <c:out value="${child.name}"/><br />
          </c:forEach>
          </display:column>

           
    • veejar75

      veejar75 - 2005-05-05

      Hi Matt,

          The version of display.tld I'm using doesn't support ID attribute, so I doubt I can use this functionality at this point. So I will evaluate what are the updates I need to make to use this and will try again.
      

      Thanks A Lot for your Help

       
    • veejar75

      veejar75 - 2005-05-06

      Looks like I need to updgrade from strtus 1.1 to struts 1.2, is there any away of doing it using struts 1.1 only.

      Thanks
      Rk

       

Log in to post a comment.

MongoDB Logo MongoDB