struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "SCOTT VENTER" <SCOTT.VEN...@tebabank.com>
Subject RE: Can't uncheck multibox
Date Tue, 23 Sep 2003 07:46:28 GMT
Whats your point mate? You are basically agreeing with me.

Why dont you simply provide an answer instead of trying to justify your rant?

I accept your point that it should be done in the reset method.

Scott.

>>> andrew.david.hill@gridnode.com 09/23/03 09:41AM >>>
Well if you dont want your checkboxes to be untickable then by all means go
ahead and dont reset them, but Im telling ya mate, thats what reset() is
for, and the validate method isn't the proper place for it (though of course
its not going to send you blind if you do do it there).

If you dont want to reset a property (for example its on a seperate page of
a wizard that shares the same actionform instance with this page) then of
course you need to do a bit of 'logic' to work out which properties need to
be reset and which shouldnt - the rule of thumb (imho) is that you shouldnt
just anyhow reset everything, but that you should only reset values for
those fields that need it - ie: checkboxes, textareas, & multiple-selects
that were on the screen that submitted this request...

btw: This is all mostly relevant only to session scoped forms, as request
scoped forms imply that you get a clean form (new instance) every time
anyhow.

-----Original Message-----
From: SCOTT VENTER [mailto:SCOTT.VENTER@tebabank.com]
Sent: Tuesday, 23 September 2003 15:21
To: struts-user@jakarta.apache.org
Subject: RE: Can't uncheck multibox


The Actionform is in the session. I may not alway want to reset the
property.

helloooo !


>>> andrew.david.hill@gridnode.com 09/23/03 09:21AM >>>
<snip>
implicitly set the property to an empty String[];
eg. In the Validate Method()
</snip>

Helllllooooo .... this is what the reset() method is for. That is its sole
reason dee etrer. To provide a place for you to reset the values of
checkbox, textarea, & multiple-select fields associated with the page that
has just submitted.

RTFM/STFW and verily shall ye learneth.

This topic comes up so often Im surprised someone hasnt written a listbot to
answer it.

-----Original Message-----
From: SCOTT VENTER [mailto:SCOTT.VENTER@tebabank.com]
Sent: Tuesday, 23 September 2003 14:59
To: struts-user@jakarta.apache.org
Subject: Re: Can't uncheck multibox


Hi,

I had this problem when I placed my ActionForm in the Session. I noticed
that when I uncheck all the checkboxes, the browser would transmit no value
for the checkbox property and so the ActionForm property would not be
updated to an empty String[] as I had expected.

<html:multibox property="actionItemIndicator">
   <bean:write name="defectsList" property="defectId"/>
</html:multibox>

If you uncheck all the checkboxes in your example, the request query string
parameter "actionItemIndicator" would not be transmitted. i.e. there would
be no "&actionItemIndicator=" in the query string. Most browsers dont
transmit parameters when they have no values.

I worked around this problem by checking if this parameter was null, and
then implicitly set the property to an empty String[];

eg. In the Validate Method()
...
if (httpServletRequest.getParameter("actionItemIndicator") == null) {
  actionItemIndicator = new String[] {};
}

HTH.
S.

>>> natalie.d.rassmann@lmco.com 09/22/03 04:56PM >>>
Can anyone help???  I have the following multibox in a
dyanValidatorForm:

<logic:iterate id="defectsList" name="reviewRecordForm"
property="defectsList" indexId="i">
       <html:multibox property="actionItemIndicator">
               <bean:write name="defectsList" property="defectId"/>
       </html:multibox>
</logic:iterate>

I am having trouble unchecking the checkboxes.  Everytime I uncheck a
checkbox, hit submit, when the screen comes back the checkbox is still
checked.  When I extract, the form data from this property, the form
still indicates that the checkbox is checked even though I unchecked it
in the form....

How do I uncheck a box once it has been unchecked by the user???

Thanks in advance,

Natalie

############################################################################
#########
The information contained in this message and or attachments is intended
only for the person or entity to which it is addressed and may contain
confidential and/or privileged material.  Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended recipient
is prohibited. If you received this in error, please contact the sender and
delete the material from any system and destroy all copies.
############################################################################
#########



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org

############################################################################
#########
The information contained in this message and or attachments is intended
only for the person or entity to which it is addressed and may contain
confidential and/or privileged material.  Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended recipient
is prohibited. If you received this in error, please contact the sender and
delete the material from any system and destroy all copies.
############################################################################
#########



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org

#####################################################################################
The information contained in this message and or attachments is intended
only for the person or entity to which it is addressed and may contain
confidential and/or privileged material.  Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended recipient
is prohibited. If you received this in error, please contact the sender and
delete the material from any system and destroy all copies.
#####################################################################################


Mime
View raw message