[S2] Checkbox causes error on form submission.

2007-05-25 Thread Skip Hollowell

I am a wee bit confused on this one.
I have my Account bean, with a boolean field:
   private boolean billerSame = false;
along with a getter and setter, obviosuly.

On my form I have:
   s:checkbox key=payment.billerSame /

I submit the form and see this on the console for Tomcat:
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception 
catched: Error setting expression '__checkbox_payment.billerSameAsPayor' 
with value '[Ljava.lang.String;@401d45'


I am confused as to where this _checkbox_payment notation came from.

I looked at the generated page, and lo and behold there is this:

input type=checkbox name=payment.billerSame value=true 
id=Payment_retrieveFeeSingle_payment_billerSame /
input type=hidden name=__checkbox_payment.billerSameAsPayor 
value=true/ label for=Payment_retrieveFeeSingle_payment_billerSame 
class=checkboxLabelDoes the Billing Address match?/label


I get the first input, but the second hidden one? That is obviously 
where the error is coming from, but why/how?  I do have validate turned 
on, so is that how the extra field is getting generated for checkboxes?  
Help.


OK Dave, feel free to show me which doc page I missed this time.  :) 





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



Re: [S2] Checkbox causes error on form submission.

2007-05-25 Thread Dave Newton
--- Skip Hollowell [EMAIL PROTECTED] wrote:
 I get the first input, but the second hidden one?
 That is obviously where the error is coming from,
but
 why/how?  I do have validate turned on, so is that 
 how the extra field is getting generated for 
 checkboxes?  
 
 OK Dave, feel free to show me which doc page I
 missed this time.  :) 

*lol*

The hidden field is generated because of the way HTTP
deals with checkboxes--since checkboxes aren't
submitted if they're not checked, having the hidden
field means that you'll get the unchecked value when
submitted.

(If you're familiar with S1 you'll undoubtedly
remember the dreaded reset ActionForm method.)

That said I'm not sure about the error (and can't
check my code at the moment) at this point.

d.



   
Get
 the Yahoo! toolbar and be alerted to new email wherever you're surfing.
http://new.toolbar.yahoo.com/toolbar/features/mail/index.php

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



Re: [S2] Checkbox causes error on form submission.

2007-05-25 Thread WongTseng

It's so strange. If the hidden field is generated to solve the problem of
submitting checkboxs' values unchecked , the filed should look like this:
input type=hidden name=payment.billerSame value=true/

By the way, where is the AsPayor come from? What's the strategy used by S2
to generate the names of thses hidden fileds?

2007/5/26, Dave Newton [EMAIL PROTECTED]:


--- Skip Hollowell [EMAIL PROTECTED] wrote:
 I get the first input, but the second hidden one?
 That is obviously where the error is coming from,
but
 why/how?  I do have validate turned on, so is that
 how the extra field is getting generated for
 checkboxes?

 OK Dave, feel free to show me which doc page I
 missed this time.  :)

*lol*

The hidden field is generated because of the way HTTP
deals with checkboxes--since checkboxes aren't
submitted if they're not checked, having the hidden
field means that you'll get the unchecked value when
submitted.

(If you're familiar with S1 you'll undoubtedly
remember the dreaded reset ActionForm method.)

That said I'm not sure about the error (and can't
check my code at the moment) at this point.

d.




Get
the Yahoo! toolbar and be alerted to new email wherever you're surfing.
http://new.toolbar.yahoo.com/toolbar/features/mail/index.php

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





--
Wong Tseng
王曾