Wendy,

Yes, you could blame HTML spec for sending only successful form
elements. But I'd use a little more positive attitude to address this
problem. :)

Could this approach resolve this problem so that make Struts more
powerful? Instead of "looping through parameters in a request" and
setting the form bean properties, could the logic "loop through the form
bean properties" and set them by retrieving the values from the request?
For a certain property, if the value doesn't present in the request,
reset this property.

I am using the "not present in a request" condition to trigger an
individual property reset as a work around. I am also using the
"recommended" approach to reset entire session scoped form bean. If the
said approach is used, both these resets are not necessary. Application
developers will much happier to use Struts.

Thanks,
Sherwin

-----Original Message-----
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 01, 2006 4:04 PM
To: Struts Developers List
Subject: Re: De-select sticky options doesn't work

On 9/1/06, Wang, Sherwin X. <[EMAIL PROTECTED]> wrote:

> Since the framework fails in this case, I have to reset the properties

> in the application as a work around. Shouldn't Struts be enhanced to 
> support this capability if there wasn't one?

http://struts.apache.org/1.x/struts-taglib/faq.html#checkbox

As you mention, the real issue is that browsers only submit successful
form elements, and an unchecked checkbox is not a successful form
element.  Using the reset method of a session scoped form to clear
checkboxes has long been the recommended approach.  I'd argue that you
are working around the limits of the HTML specification, not Struts.
:)

If you are using dynamic form beans configured in struts-config.xml,
Struts 1.3 introduces a 'reset' attribute for <form-property>.  I just
recently discovered it and haven't tried it yet.

http://struts.apache.org/1.x/struts-core/dtddoc/org/apache/struts/resour
ces/struts-config_1_3.dtd.html#form-property

reset  - The flag that indicates when this property should be reset to
its "initial" value when the form's "reset()" method is called.  If this
is set to "true", the property is always reset when "reset()" is called.
This can also be set to one or more HTTP methods, such as GET or POST.
In such a case, the property will be reset only when the HTTP method
used for the request being processed is included in this attribute's
value(s). Multiple HTTP methods can be specified by separating them with
whitespace or commas.

Here's a related JIRA issue:
https://issues.apache.org/struts/browse/STR-2265

HTH,
--
Wendy

---------------------------------------------------------------------
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