You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Simon MARTIN <si...@gmx.at> on 2005/03/24 11:57:03 UTC

Binding to property of layer one in two layer nested context

Hi,

I'm using the nested taglib like this:

<nested:iterate id="diplomarbeit" property="diplomarbeiten" indexId="daId">
...
    <nested:iterate id="schuelerDiplomarbeit" property="schuelerDiplomarbeiten" 
indexId="index">
         <nested:text property="note" />
            ....
            <nested:checkbox name="diplomarbeit" property="toChange" /><%-- 
problem! --%>
        </nested:iterate>
</nested:iterate>

Everything works fine with the <nested:text>-tag (which gives me something like 
diplomarbeiten[0].schuelerDiplomarbeiten[0].note and so on),
but the checkbox does not work ... I want to bind it to 
diplomarbeit[0].toChange, but unfortunately, they rendered HTML checkbox looks 
like this:

<input type="checkbox" name="toChange" value="on" />

thus, it can't be mapped backed anymore. I tried adding the 'indexed="true"' 
attribute as well, but the index it bind's to is the inner one (index), whereas
I'd need 'daId'.

Any ideas how I could solve this?

Thanks in advance,
   Simon

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


Re: Binding to property of layer one in two layer nested context

Posted by Hubert Rabago <hr...@gmail.com>.
Take a look at the tutorials in
http://www.keyboardmonkey.com/next/Advanced.jsp?content=yesplease -- I
think it describes what you're trying to do.  I haven't had a need for
it yet, but based on its text, you may end up with something like
<nested:checkbox property="../../toChange" /> or something similar. 
Personally though, I haven't tried it yet.

Hubert

On Thu, 24 Mar 2005 11:57:03 +0100, Simon MARTIN <si...@gmx.at> wrote:
> Hi,
> 
> I'm using the nested taglib like this:
> 
> <nested:iterate id="diplomarbeit" property="diplomarbeiten" indexId="daId">
> ...
>    <nested:iterate id="schuelerDiplomarbeit" property="schuelerDiplomarbeiten"
> indexId="index">
>         <nested:text property="note" />
>            ....
>            <nested:checkbox name="diplomarbeit" property="toChange" /><%--
> problem! --%>
>        </nested:iterate>
> </nested:iterate>
> 
> Everything works fine with the <nested:text>-tag (which gives me something like
> diplomarbeiten[0].schuelerDiplomarbeiten[0].note and so on),
> but the checkbox does not work ... I want to bind it to
> diplomarbeit[0].toChange, but unfortunately, they rendered HTML checkbox looks
> like this:
> 
> <input type="checkbox" name="toChange" value="on" />
> 
> thus, it can't be mapped backed anymore. I tried adding the 'indexed="true"'
> attribute as well, but the index it bind's to is the inner one (index), whereas
> I'd need 'daId'.
> 
> Any ideas how I could solve this?
> 
> Thanks in advance,
>   Simon
> 
> ---------------------------------------------------------------------
> 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