You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Morris <Da...@plumcreek.com> on 2002/06/03 18:14:33 UTC

Nested iterate name

I am using the 1.1b1 nested tags and ran into something that 
seems inconsistent. When I specify a form like:

<html:form action="myform">
<nested:iterate name="mybean" property="mybeanproperty">
<nested:text property="mybeanpropertyproperty">
...

I get an error that mybeanproperty, which is an ArrayList  is not 
found in myform? If I create a getter in my form bean for mybean 
it works OK. I really don't want to do this unless there is a way to 
get the request associated with a form bean. 

The following sort of thing does work so I have to question whether 
I am using the nested tags properly:

<html:form action="myform">
<html:select property="mybeanproperty">
<html:options name="mybean"
property="mybeanproperty.mybeanpropertyproperty">
...

How do I tell the nested:iterate tag to use the bean I specified 
rather than the form bean?

Thanks,

David Morris



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Nested iterate name

Posted by Arron Bates <ar...@pacific.net.au>.
David,

You can wedge a <nested:root> tag within the form tag. The child tags to 
the root tag will only see the root tag, and those outside the scope of 
the root tag won't know it's there either.

Example...
<html:form action="/myform.do">

    <nested:root name="myOtherBean">
        <nested:iterate property="myBenProperty">
            <nested:text property="myBeanPropertyProperty" />
        </nested:iterate>
    </nested:root>

    <nested:nest>
        [... other nesting exploits ...]
    </nested:nest>

</html:form>


    ...will work just fine. The stuff within the root tag will only be 
working against that bean, and the "other nesting exploits" stuff will 
be working against the form bean. As soon as the tags hit a valid root 
tag, they stop there and use that one. Which is what makes the above 
possible.

Is this the answer you're looking for?...


Arron.



David Morris wrote:

>I am using the 1.1b1 nested tags and ran into something that 
>seems inconsistent. When I specify a form like:
>
><html:form action="myform">
><nested:iterate name="mybean" property="mybeanproperty">
><nested:text property="mybeanpropertyproperty">
>...
>
>I get an error that mybeanproperty, which is an ArrayList  is not 
>found in myform? If I create a getter in my form bean for mybean 
>it works OK. I really don't want to do this unless there is a way to 
>get the request associated with a form bean. 
>
>The following sort of thing does work so I have to question whether 
>I am using the nested tags properly:
>
><html:form action="myform">
><html:select property="mybeanproperty">
><html:options name="mybean"
>property="mybeanproperty.mybeanpropertyproperty">
>...
>
>How do I tell the nested:iterate tag to use the bean I specified 
>rather than the form bean?
>
>Thanks,
>
>David Morris
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>