FAQ
Hi,

I have a common problem :-) I have a collection of Objects and these Objects
also contains Collections. How can I iterate through the child collection?

Something like this:

<s:iterator value="accountSearchResults.accounts" status="rowstatus"
var="account">


<s:iterator value="#account.attorneys" status="rowstatus"
var="attorney">

</s:iterator>

</s:iterator>


Is this possible?

Best Regards,
Marc

Search Discussions

  • Dave Newton at Dec 4, 2007 at 5:19 pm
    Sure.

    Did you try it and had an issue, or did you think it would be quicker to wait
    for a response on the list?

    d.

    --- Marc Eckart wrote:
    Hi,

    I have a common problem :-) I have a collection of Objects and these
    Objects
    also contains Collections. How can I iterate through the child collection?

    Something like this:

    <s:iterator value="accountSearchResults.accounts"
    status="rowstatus"
    var="account">


    <s:iterator value="#account.attorneys" status="rowstatus"
    var="attorney">

    </s:iterator>

    </s:iterator>


    Is this possible?

    Best Regards,
    Marc

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
    For additional commands, e-mail: user-help@struts.apache.org
  • Marc Eckart at Dec 4, 2007 at 5:25 pm
    I tried this with the var in the iterator tag and tomcat e.g. jasper
    complained about that var is not defined in the tag. Is it deprecated or new
    or something like this. Maybe I have to update my struts jar?

    Marc

    2007/12/4, Dave Newton <newton.dave@yahoo.com>:
    Sure.

    Did you try it and had an issue, or did you think it would be quicker to
    wait
    for a response on the list?

    d.

    --- Marc Eckart wrote:
    Hi,

    I have a common problem :-) I have a collection of Objects and these
    Objects
    also contains Collections. How can I iterate through the child
    collection?
    Something like this:

    <s:iterator value="accountSearchResults.accounts"
    status="rowstatus"
    var="account">


    <s:iterator value="#account.attorneys" status="rowstatus"
    var="attorney">

    </s:iterator>

    </s:iterator>


    Is this possible?

    Best Regards,
    Marc

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
    For additional commands, e-mail: user-help@struts.apache.org
  • Dave Newton at Dec 4, 2007 at 5:34 pm
    S2.0.mumble uses the "id" attribute to name the current iteration object.
    S2.1 uses "var". Depends on what version you're using, I guess.

    d.

    --- Marc Eckart wrote:
    I tried this with the var in the iterator tag and tomcat e.g. jasper
    complained about that var is not defined in the tag. Is it deprecated or
    new
    or something like this. Maybe I have to update my struts jar?

    Marc

    2007/12/4, Dave Newton <newton.dave@yahoo.com>:
    Sure.

    Did you try it and had an issue, or did you think it would be quicker to
    wait
    for a response on the list?

    d.

    --- Marc Eckart wrote:
    Hi,

    I have a common problem :-) I have a collection of Objects and these
    Objects
    also contains Collections. How can I iterate through the child
    collection?
    Something like this:

    <s:iterator value="accountSearchResults.accounts"
    status="rowstatus"
    var="account">


    <s:iterator value="#account.attorneys" status="rowstatus"
    var="attorney">

    </s:iterator>

    </s:iterator>


    Is this possible?

    Best Regards,
    Marc

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

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
    For additional commands, e-mail: user-help@struts.apache.org
  • Marc Eckart at Dec 4, 2007 at 5:49 pm
    Ah perfect. I looked at the tag reference on the struts2 page and there was
    the var attribute.
    I'm actually using 2.0.8. So this can not work :-)

    Thank you very much :-)

    Marc

    2007/12/4, Dave Newton <newton.dave@yahoo.com>:
    S2.0.mumble uses the "id" attribute to name the current iteration object.
    S2.1 uses "var". Depends on what version you're using, I guess.

    d.

    --- Marc Eckart wrote:
    I tried this with the var in the iterator tag and tomcat e.g. jasper
    complained about that var is not defined in the tag. Is it deprecated or
    new
    or something like this. Maybe I have to update my struts jar?

    Marc

    2007/12/4, Dave Newton <newton.dave@yahoo.com>:
    Sure.

    Did you try it and had an issue, or did you think it would be quicker
    to
    wait
    for a response on the list?

    d.

    --- Marc Eckart wrote:
    Hi,

    I have a common problem :-) I have a collection of Objects and these
    Objects
    also contains Collections. How can I iterate through the child
    collection?
    Something like this:

    <s:iterator value="accountSearchResults.accounts"
    status="rowstatus"
    var="account">


    <s:iterator value="#account.attorneys"
    status="rowstatus"
    var="attorney">

    </s:iterator>

    </s:iterator>


    Is this possible?

    Best Regards,
    Marc

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

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriesstruts
postedDec 4, '07 at 5:13p
activeDec 4, '07 at 5:49p
posts5
users2
websitestruts.apache.org
irc#struts

2 users in discussion

Marc Eckart: 3 posts Dave Newton: 2 posts

People

Translate

site design / logo © 2022 Grokbase