S2 2.0.11. The selected field is a boolean. And there are isSelected() and setSelected() methods.

Thanks for asking.


On Aug 7, 2008, at Thursday, August 7, 2008 - 9:24 AM, Gabriel Belingueres wrote:

Which version of S2 are you using?
The selected field: Is it boolean or Boolean?
Did you write a getSelected() getter? or is it an isSelected() getter?

2008/8/7, Kevin Wade <[EMAIL PROTECTED]>:
This is probably simple and I think I'm close, but I can't quite get it to work: the proper ognl expression to use to get the value of a checkbox w/in
nested iterator tags.

I've got an ArrayList of Parent objects called parentList. Each Parent object contains another array of Child objects called childList. A Child
object has an boolean field called "selected."

If I nest the iterators like so:
<s:iterator value="parentList" status="parentliststatus">
      <s:iterator value="childList" status="childliststatus">

Then what would be the correct expression to use for a checkbox to get the value of selected? I tried the following, but it doesn't seem to work:

<s:checkbox
name="%{'parentList['+#parentliststatus.index +'].childList['+#childliststatus.index+'].selected'}"
value="selected"></s:checkbox>

That, in turn, produces some html like this:

<input type="checkbox"
name="parentList[1].childList[2].selected" value="true"
checked="checked"
id="commentsPrint_parentList_1__childList_2__selected"/>
<input type="hidden"
name="__checkbox_parentList[1].childList[2].selected"
value="true" />

But, that doesn't appear to work. I continue to get setParameter errors
when I submit the form:
DEBUG
com.opensymphony.xwork2.interceptor.ParametersInterceptor
- Setting params parentList[1].childList[2].selected => [
true ]
ERROR
com.opensymphony.xwork2.interceptor.ParametersInterceptor
- ParametersInterceptor - [setParameters]: Unexpected Exception caught
setting 'parentList[1].childList[2].selected' on 'class
com.blackstream.yardly.actions.comments.CommentsPrintAction:
Error setting expression
'parentList[1].childList[2].selected' with value
'[Ljava.lang.String;@6d650f'

Any ideas what I'm doing wrong?

Kevin

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



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

Reply via email to