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 Gagnon <dg...@siunik.com> on 2005/11/16 14:07:24 UTC

Is Struts supports indexed property like itemForSale[1].lineDetail[4].selected ... I searched but haven't found how?

Hi all,

  Sorry for this question that I tought trivial . but I haven't found my 
answer in the list . .so I ask you.

  <logic:iterate name="purchaseConsolidationItemForSaleForm" 
property="itemForSale" id="itemForSale" indexId="ctr" >
                       <logic:iterate name="itemForSale" 
property="lineDetail" id="lineDetail" indexId="ctr2">
                                    <html:checkbox name="lineDetail" 
property="selected" indexed="true"  />
                       </logic:iterate>
 </logic:iterate>


The code over gives:

<input id="lineDetail[0].selected" name="lineDetail[0].selected" value="on" class="contentBaseInlinedText" type="checkbox">


But I would like

<input id="itemForSale[1].lineDetail[0].selected" name="lineDetail[0].selected" value="on" class="contentBaseInlinedText" type="checkbox">


I guess struts don't support that... If yes is there a way I would be 
able to validate it?

Thanks for your help!!!

/David



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


Re: Is Struts supports indexed property like itemForSale[1].lineDetail[4].selected ... I searched but haven't found how?

Posted by David Gagnon <dg...@siunik.com>.
Thanks for the info!

I'll have a look !

Best regards
/David

Niall Pemberton wrote:

>As Rahul points out the "nested" taglib should do what you want. Validator
>doesn't support two levels like this - one option would be to use the
>"extends" validator I wrote:
>
>http://www.niallp.pwp.blueyonder.co.uk/strutsvalidatorextends.html#twolevels
>
>Niall
>
>----- Original Message ----- 
>From: "David Gagnon" <dg...@siunik.com>
>To: "'Struts Users Mailing List'" <us...@struts.apache.org>
>Sent: Wednesday, November 16, 2005 1:07 PM
>Subject: Is Struts supports indexed property like
>itemForSale[1].lineDetail[4].selected ... I searched but haven't found how?
>
>
>  
>
>>Hi all,
>>
>>  Sorry for this question that I tought trivial . but I haven't found my
>>answer in the list . .so I ask you.
>>
>>  <logic:iterate name="purchaseConsolidationItemForSaleForm"
>>property="itemForSale" id="itemForSale" indexId="ctr" >
>>                       <logic:iterate name="itemForSale"
>>property="lineDetail" id="lineDetail" indexId="ctr2">
>>                                    <html:checkbox name="lineDetail"
>>property="selected" indexed="true"  />
>>                       </logic:iterate>
>> </logic:iterate>
>>
>>
>>The code over gives:
>>
>><input id="lineDetail[0].selected" name="lineDetail[0].selected"
>>    
>>
>value="on" class="contentBaseInlinedText" type="checkbox">
>  
>
>>But I would like
>>
>><input id="itemForSale[1].lineDetail[0].selected"
>>    
>>
>name="lineDetail[0].selected" value="on" class="contentBaseInlinedText"
>type="checkbox">
>  
>
>>I guess struts don't support that... If yes is there a way I would be
>>able to validate it?
>>
>>Thanks for your help!!!
>>
>>/David
>>    
>>
>
>
>
>---------------------------------------------------------------------
>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


Re: Is Struts supports indexed property like itemForSale[1].lineDetail[4].selected ... I searched but haven't found how?

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
As Rahul points out the "nested" taglib should do what you want. Validator
doesn't support two levels like this - one option would be to use the
"extends" validator I wrote:

http://www.niallp.pwp.blueyonder.co.uk/strutsvalidatorextends.html#twolevels

Niall

----- Original Message ----- 
From: "David Gagnon" <dg...@siunik.com>
To: "'Struts Users Mailing List'" <us...@struts.apache.org>
Sent: Wednesday, November 16, 2005 1:07 PM
Subject: Is Struts supports indexed property like
itemForSale[1].lineDetail[4].selected ... I searched but haven't found how?


> Hi all,
>
>   Sorry for this question that I tought trivial . but I haven't found my
> answer in the list . .so I ask you.
>
>   <logic:iterate name="purchaseConsolidationItemForSaleForm"
> property="itemForSale" id="itemForSale" indexId="ctr" >
>                        <logic:iterate name="itemForSale"
> property="lineDetail" id="lineDetail" indexId="ctr2">
>                                     <html:checkbox name="lineDetail"
> property="selected" indexed="true"  />
>                        </logic:iterate>
>  </logic:iterate>
>
>
> The code over gives:
>
> <input id="lineDetail[0].selected" name="lineDetail[0].selected"
value="on" class="contentBaseInlinedText" type="checkbox">
>
>
> But I would like
>
> <input id="itemForSale[1].lineDetail[0].selected"
name="lineDetail[0].selected" value="on" class="contentBaseInlinedText"
type="checkbox">
>
>
> I guess struts don't support that... If yes is there a way I would be
> able to validate it?
>
> Thanks for your help!!!
>
> /David



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


Re: Is Struts supports indexed property like itemForSale[1].lineDetail[4].selected ... I searched but haven't found how?

Posted by Rahul Akolkar <ra...@gmail.com>.
On 11/16/05, David Gagnon <dg...@siunik.com> wrote:
> Hi all,
>
>  Sorry for this question that I tought trivial . but I haven't found my
> answer in the list . .so I ask you.
>
>  <logic:iterate name="purchaseConsolidationItemForSaleForm"
> property="itemForSale" id="itemForSale" indexId="ctr" >
>                       <logic:iterate name="itemForSale"
> property="lineDetail" id="lineDetail" indexId="ctr2">
>                                    <html:checkbox name="lineDetail"
> property="selected" indexed="true"  />
>                       </logic:iterate>
>  </logic:iterate>
>
>
> The code over gives:
>
> <input id="lineDetail[0].selected" name="lineDetail[0].selected" value="on" class="contentBaseInlinedText" type="checkbox">
>
>
> But I would like
>
> <input id="itemForSale[1].lineDetail[0].selected" name="lineDetail[0].selected" value="on" class="contentBaseInlinedText" type="checkbox">
>
<snip/>

Try the nested tags [1].

-Rahul

[1] http://struts.apache.org/struts-taglib/tagreference-struts-nested.html


>
> I guess struts don't support that... If yes is there a way I would be
> able to validate it?
>
> Thanks for your help!!!
>
> /David
>

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