struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillermo Meyer" <>
Subject RE: Boolean checkbox in session form
Date Mon, 29 Dec 2003 21:39:50 GMT
To solve this problem, i created a new taglib for checkbox (extending
BaseFieldTag), that creates a hidden input with a value of true|false
and an auxiliary checkbox (named as <propertyName> + _chk) with a
javascript handler that checks on checkbox value to set true or false to
the hidden field, so always is posted a true or a false value from UI
and set to the appropiate form attribute, and this way you can avoid
reseting value in reset form.

-----Original Message-----
From: Franck [] 
Sent: Lunes, 29 de Diciembre de 2003 06:13 p.m.
To: 'Struts Users Mailing List'
Subject: Boolean checkbox in session form


I'm becoming mad ...

Explain : to handle ActionForm boolean properties with HTML checkbox, we
"need" To initialize the property as "false" in the reset() method of
the ActionForm .. Ok

Now, if the Action form is defined in the session scope in the
struts-config file The first time the action is called, the bean is put
in session scope.

The next time (eg submit of another form on the same page), the bean is
readed from session scope (RequestProcessor.processActionForm) ... ok
After that, the reset() method is called

So it's impossible to keep the boolean property as "true" ....

How can I store the form bean in the session scope with a "true" boolean
property ? Or maybe is there a way to not initialize the boolean
properties as "false" (and update them with checkboxes )

Is my problem understandable ??

Thanks ...

Franck Lefebure
equipe web

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message