Ok, I've got progress...

I've downloaded the latest struts build wich contains the NESTED tags...

I'm trying to use the nested:iterate and nested:radio, but I couldn'g get grip of 
everything from the docs that comes together... So if there's anyone out there that 
has used the nested tags properly I'll appreciate the help..

After, several tries, the best result I have is:

<nested:iterate id="items" ...>

        <nested:itearate id="tests" ...>
        <nested:root name="tests"

                <nested:iterate id="answer" ...>
                        <nested:radio name="answer" ...>
                </nested:iterate>
        </nested:root>
        </nested:iterate>
</nested:iterate>

It seems that it got almost right, but it looks like tests looses it's index providing 
a result:
<input type="radio" name="tests[0].answer[0].responseID" value="OK">
<input type="radio" name="tests[0].answer[0].responseID" value="NOK">
<input type="radio" name="tests[1].answer[1].responseID" value="OK">
<input type="radio" name="tests[1].answer[1].responseID" value="NOK">

That is my first line on a table (All supposed to be based on tests[0] only... The 
second row is the one supposed to be tests[1], but instead it repeats the tests[0] and 
tests[1] the same way as the lines above...

If I move the root to items, like:
<nested:iterate id="items" ...>
<nested:root name="items">
        <nested:itearate id="tests" ...>


                <nested:iterate id="answer" ...>
                        <nested:radio name="answer" ...>
                </nested:iterate>
        </nested:iterate>
        </nested:root>
</nested:iterate>

It looks a little bit better, but items looses it's indexing as well with the same 
behavior as above for tests...

Besides if tests works properly that is enought to identify my radio groups. While 
with the extra level for the items (output below), I don't know how the Actionform 
will behave...
<input type="radio" name="items[0].tests[0].responses[0].responseID" value="OK">
<input type="radio" name="items[0].tests[0].responses[0].responseID" value="NOK">
<input type="radio" name="items[1].tests[0].responses[1].responseID" value="OK">
<input type="radio" name="items[1].tests[0].responses[1].responseID" value="NOK">

As you can see, on the above output everything was fine IF the items[x] doesn't 
print....

Thanks,
Marcelo.



On Wed, 13 Mar 2002 10:58:43 -0500
Olexander Rudyy <[EMAIL PROTECTED]> wrote:

> Look at  http://www.keyboardmonkey.com/struts/index.html
> ----- Original Message -----
> From: "Marcelo Caldas" <[EMAIL PROTECTED]>
> Newsgroups: Struts
> To: "Struts Mailing List" <[EMAIL PROTECTED]>
> Sent: Wednesday, March 13, 2002 4:25 PM
> Subject: Nested Iterates...
> 
> 
> > Hi guys,
> >
> > I have a <logic:iterate> inside a <logic:iterate> tag in the following
> manner:
> >
> > <logic:iterate id="items" ...>
> > <logic:iterate id="tests" ...>
> > <html:radio name="tests" property="value" indexed="true"/>
> > ...
> >
> >
> > The problem is that the HTML being generated is like
> >
> > <input type="radio" name="tests[0].value">
> >
> > when actually I want to group them as items as well, like:
> >
> > <input type="radio" name="items[0].tests[0].value">
> >
> > Anyone knows how to have such output?
> >
> > thanks,
> > Marcelo.
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to