You have my sympathies Jim!

I have been wrestling with this same problem.  I am attempting to fix a bug
in some code that uses a multibox.  I too had a reset method called by
struts (1.02).  My problem is that I only wanted to call the reset method
when I submitted the search initially.  There were times when I returned to
the search page and I wanted the search criteria (including my checkbox
value) to still be there.  Unfortunately the struts calls the reset method
all the time resetting the checkbox value.

I have since worked around this by putting a branch around the checkbox
reset in the actionForm obtaining a value from the request which is only set
when the search is first submitted.  This ensures that the checkbox value is
only reset when the search is submitted in the first place and not when
returned to.

Is there any intention to modify the html:multibox tag so that it submits a
value for when it is unchecked?

regards,
Chris.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 31 March 2004 09:16
To: [EMAIL PROTECTED]
Subject: SV: Problem with html:multibox not clearing


Hi

Have a reset() (Inherited from ActionForm) method in you form bean.

In it you set all Boolean/boolean variables to false/null. That way,
because a nonselected value is never submitted, when you get tne value
from the form bean, it is false/null

Hermod

-----Opprinnelig melding-----
Fra: Jim Kennedy [mailto:[EMAIL PROTECTED]
Sendt: 30. mars 2004 22:06
Til: 'Struts Users Mailing List'
Emne: Problem with html:multibox not clearing


 I am using an html:multibox that is pretty much working fine except
when I
uncheck all choices. I am also using the logic:iterate tag to generate
many
checkboxes.  If I have a single box checked I can't seem to uncheck it
if
it's the last one.  If I have several checked, I can uncheck them one at
a
time and that works.  At least until I get down to just one checked.
Very
odd.  The problem seems to be that I can't get Struts to realize that
there
are no checkboxes checked after I submit the form.

I am using struts 1.1, with DynaValidatorForm's.  Here's some of my
code:

...
<form-property name="amenity"           type="java.lang.String[]" />


...
        <td colspan="4">
        <logic-el:iterate id="item" name="amenities" indexId="i">
                <html-el:multibox  property="amenity">
                        <bean:write name="item" property="code"/>
                </html-el:multibox>
                        <bean:write name="item"
property="description"/>&nbsp;&nbsp;
        </logic-el:iterate>
        </td>

Don't think the above is the issue.  It's something deeper I think.

Any help is appreciated.

Jim Kennedy
IT Consultant



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


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that DnB NOR cannot
accept any payment orders or other legally binding correspondence with
customers as a part of an email. 

This email message has been virus checked by the virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


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

Reply via email to