Got it, quite useful. Thanks for all you guys' help! 2009/1/18 <abhijit.sulh...@gmail.com>
> Makes perfect sense if interested in matching the values from checkbox > list. Another variation, I think in that case would be to use the > 'fieldValue' instead of name; that way the set values can be easier > to retrieve as a list using the name encapsulator. > > <s:iterator value="test_list" status="status"> > <s:checkbox name="test_string" value="true" fieldValue="%{top}"> > </s:iterator> > > - Abhijit Sulhyan > > On 1/18/09, Wes Wannemacher <w...@wantii.com> wrote: > > On Sunday 18 January 2009 00:47:51 Nuwan Chandrasoma wrote: > >> <s:iterator value="test_list" status="status"> > >> <s:checkbox name="test_string_%{#status.index}" value="true"> > >> </s:iterator> > >> > >> Thanks, > >> > >> Nuwan C > >> > > > > Nuwan, > > > > I'm not sure if that is what he is intending. It will work, but for what > > seems > > to be the wrong reasons. If "test_list" contains the values to iterate > over, > > then I would use those, rather than the loop index. > > > > <s:iterator value="test_list" status="status"> > > <s:checkbox name="%{'test_string_' + top}" value="true"> > > </s:iterator> > > > > This is a slightly different variation of the OGNL, as I enclosed the > whole > > expression. Also, "top" will point to the value on the top of the Value > > Stack, > > which will contain the value pushed onto it by the s:iterator tag. > > > > -Wes > > -- > > > > Wes Wannemacher > > Author - Struts 2 In Practice > > Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more > > http://www.manning.com/wannemacher > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- Best Regards, Licco