The issue is that an unchecked checkbox does not send a value when a
form is submitted, so:
This depends on (a) whether or not we're talking about S2 and (b) if we are
whether or not we're using an interceptor stack that includes the checkbox
interceptor.
I just meant that an HTTP Server
--- David Durham, Jr. wrote:
Peter L. Berghold wrote:
Where the trouble comes in is if the field is unchecked which I thought
would set the value of the Boolean to false. It doesn't, it remains
as a true.
How do I implement behavior where if the checkbox is unchecked it sets
the
On Jan 2, 2008 10:59 PM, ravi_eze [EMAIL PROTECTED] wrote:
hi,
the workaround works, but causes problems if the checkbox should be
validated. More over the soln is based on assumptions that need not hold
always.
Which solution are you saying is based on assumptions that need not
hold, and
Where the trouble comes in is if the field is unchecked which I thought
would set the value of the Boolean to false. It doesn't, it remains
as a true.
How do I implement behavior where if the checkbox is unchecked it sets
the corresponding property of the form to false?
The issue is that
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
David Durham, Jr. wrote:
request.getParameter(myUncheckedCheckbox) == null
Oh.. yuck.. but thanks David for that work around. Tried it and it
works for my purposes.
-
Peter L. Berghold Unix Professional
[EMAIL
request.getParameter(myUncheckedCheckbox) == null
Oh.. yuck.. but thanks David for that work around. Tried it and it
works for my purposes.
There are things that can be done to avoid to the ugly null check.
1. Don't initialize check-box fields. No initial values.
2. Don't use
.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
View this message in context:
http://www.nabble.com/unexpected-behavior-with-a-checkbox.-tp14572206p14591715.html
Sent from the Struts - User mailing list archive at Nabble.com
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi folks,
I have a form that the values for each field is populated as a result of
a database query. One of the fields on the form is rendered as a
checkbox and the corresponding table column is a boolean.
When I pull in a true value from the
8 matches
Mail list logo