To: Struts Users Mailing List
Subject: Re: Checkbox problem?
oki, maybe my explanation isn't the best :) (I know that I can't do it
in the reset method, as it is clearly not working) but I am still not
sure where to put the code to set the checkbox to true then.
As far as I know, the action
Can you describe what's going on in more detail?
--
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org
- Original Message -
From: Bjorn T Johansen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 4:26 AM
Subject: Checkbox problem?
I
I would suggest not doing the propagate in the reset. Just use it for the original
values. The values entered on the form are automatically propagated by struts after
the reset by the setters and getters. Just put in some logging or print statements
in those methods and you will see when
I had some issues with the methods, so I came up with something else that
works very nicely.
In the JSP, right after the code for the checkbox, use:
jsp:setProperty name=beanName property=checkboxProperty value=false
/
This allows the form submission to work correctly, without any messy code.
Yes, but to clarify...
I am showing a jsp page with values read from a database. If the
checkbox value is true, how do I then make the checkbox on my jsp-page
checked and how do I then find out if the checkbox has been unchecked?
Do I have to manually read the posted data and see if the checkbox
In your ActionForm reset() method, set the checkbox
value to false.
Struts will set the value to true if the box is
checked.
If you are using DynaForms, you will need to extend it
and override the reset() method.
To populate the checkbox initially, you need to
instantiate and populate the form
[EMAIL PROTECTED]
| Yes, but to clarify...
| I am showing a jsp page with values read from a database. If the
| checkbox value is true, how do I then make the checkbox on my jsp-page
| checked and how do I then find out if the checkbox has been unchecked?
| Do I have to manually read the posted
You are missing my point! If I just could set the checkbox value to
false in the reset method, everything is fine. But there are times when
that value has to be reset to true and not false and if I do that in my
reset method, I am not able to see of the user unchek the checkbox,
because the
On Tuesday 10 June 2003 14:11, Bjørn T Johansen wrote:
You are missing my point! If I just could set the checkbox value to
false in the reset method, everything is fine. But there are times when
that value has to be reset to true and not false and if I do that in my
reset method, I am not able
Go get 'em, James!
-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 2:29 PM
To: Struts Users Mailing List
Subject: Re: Checkbox problem?
On Tuesday 10 June 2003 14:11, Bjørn T Johansen wrote:
You are missing my point! If I just could set
oki, maybe my explanation isn't the best :) (I know that I can't do it
in the reset method, as it is clearly not working) but I am still not
sure where to put the code to set the checkbox to true then.
As far as I know, the action class isn't called before after the form
bean has called the reset
: Re: Checkbox problem?
oki, maybe my explanation isn't the best :) (I know that I can't do it
in the reset method, as it is clearly not working) but I am still not
sure where to put the code to set the checkbox to true then.
As far as I know, the action class isn't called before after the form
You can pre-populate the form in a previous action. Here is an example.
http://jakarta.apache.org/struts/faqs/newbie.html#prepopulate
-Kevin
--- Bjørn T Johansen [EMAIL PROTECTED] wrote:
oki, maybe my explanation isn't the best :) (I know that I can't do it
in the reset method, as it is
are set or not.
-Original Message-
From: Bjørn T Johansen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 12:38 PM
To: Struts Users Mailing List
Subject: Re: Checkbox problem?
oki, maybe my explanation isn't the best :) (I know that I can't do it
in the reset method
this clarifies things.
Steve
-Original Message-
From: Bjørn T Johansen [mailto:[EMAIL PROTECTED]
Sent: June 10, 2003 12:38 PM
To: Struts Users Mailing List
Subject: Re: Checkbox problem?
oki, maybe my explanation isn't the best :) (I know that I can't do it
in the reset method
Steve wrote:
The suggested method requires two actions.
SetupAction - Form - ProcessAction
The first action prepares any values required by your form,
including setting the value of your checkboxes to true. The
second action is the one that actually processes the user
input gathered by
may u need to reset the value of the checkbox to (false or true) in the
reset method of ur formbean
-Original Message-
From: Hirschmann, Bernhard [mailto:Bernhard.Hirschmann;t-systems.com]
Sent: Monday, November 11, 2002 7:00 PM
To: '[EMAIL PROTECTED]'
Subject: checkbox problem
Hello
-
From: Saini, Deepank [mailto:deepank.saini;cgey.com]
Sent: Monday, November 11, 2002 8:33 AM
To: 'Struts Users Mailing List'
Subject: RE: checkbox problem
may u need to reset the value of the checkbox to (false or true) in the
reset method of ur formbean
-Original Message
if u want uncheck the box, after a submit , set it to false
-Original Message-
From: James Mitchell [mailto:jmitchtx;telocity.com]
Sent: Monday, November 11, 2002 7:06 PM
To: Struts Users Mailing List
Subject: RE: checkbox problem
You need to set it to false in the reset() method
Nachricht-
Von: James Mitchell [mailto:jmitchtx;telocity.com]
Gesendet: Montag, 11. November 2002 14:36
An: Struts Users Mailing List
Betreff: RE: checkbox problem
You need to set it to false in the reset() method.
James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org
If you
:
Subject: RE: checkbox problem
11/11/2002 03:46
I suppose you have several checkboxes corresponding to the List of objects.
Are you using the html:multibox tag? If not, you should. The Struts framework will
save the selected values in a String array that you provide. The value stored will be
the value of the checkbox. For example
reset the check box values in the struts form reset method.
-Original Message-
From: Sachin [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 6:35 PM
To: [EMAIL PROTECTED]
Subject: CheckBox problem in struts..
Hi
Could anyone explain about the checkbox problem in struts
if i
Hi!
I had a similar problem and solved it by changing
the attribute scope in my
action in the struts-config.xml file to request
instead of session.
/Linnéa
- Original Message -
From:
Joel Vogt
To: [EMAIL PROTECTED]
Sent: Thursday, June 28, 2001 10:04
AM
Hi all,
I've worked on it a bit more and come up with these
steps to make it work.
I use a multibox instead of a checkbox like this on
my form:
html:multibox name="model" property="member"
value="yes"/
I then also include with this a hidden
field
html:hidden name="model"
25 matches
Mail list logo