You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ravi Garg <Ra...@infosys.com> on 2003/07/14 12:09:22 UTC

Check box problem.

Hi all,

	I am using JSPs with checkboxes(<HTML:CHECKBOX property="">) in
all the screen. As we know that an "on" (or value of checkbox) is sent
as request whenever I check the checkbox. Then what is sent when I
uncheck the checkbox?? 

What I observed that if I have stored the form in session and checked
2-3 check boxes. Submited the form moved onto 2nd JSP which also uses
the same form I again check 2-3 checkboxes and want to go back and
change my selection in previous screen. So I go back an change my
selection. Now my third screen displays my all selections. But it
displays the unchecked checkboxes which I checked on my second attempt.
Could any of you tell me any solution to this problem. One solution is
to define the scope of form as request and use hidden field but I cannot
use hidden fields cause number of checkboxes is not fixed.

Regards,
Ravi

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


RE: Check box problem.

Posted by "Prashanth.S" <su...@yahoo.com>.
Hi,
make the selected array null in reset method in ur form like...
String [] arrSelectedItems={};
Dont destroy the array...
HTH
Prashanth

Andrew Hill <an...@gridnode.com> wrote:
I wouldst refereth thy attention unto the documentation for the reset()
method of the class known as ActionForm wherein shall be found all that
which thou doust require.

-----Original Message-----
From: Ravi Garg [mailto:Ravi_Garg01@infosys.com]
Sent: Monday, 14 July 2003 18:09
To: Struts Users Mailing List
Subject: Check box problem.


Hi all,

I am using JSPs with checkboxes() in
all the screen. As we know that an "on" (or value of checkbox) is sent
as request whenever I check the checkbox. Then what is sent when I
uncheck the checkbox??

What I observed that if I have stored the form in session and checked
2-3 check boxes. Submited the form moved onto 2nd JSP which also uses
the same form I again check 2-3 checkboxes and want to go back and
change my selection in previous screen. So I go back an change my
selection. Now my third screen displays my all selections. But it
displays the unchecked checkboxes which I checked on my second attempt.
Could any of you tell me any solution to this problem. One solution is
to define the scope of form as request and use hidden field but I cannot
use hidden fields cause number of checkboxes is not fixed.

Regards,
Ravi

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


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



---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

RE: Check box problem.

Posted by Andrew Hill <an...@gridnode.com>.
I wouldst refereth thy attention unto the documentation for the reset()
method of the class known as ActionForm wherein shall be found all that
which thou doust require.

-----Original Message-----
From: Ravi Garg [mailto:Ravi_Garg01@infosys.com]
Sent: Monday, 14 July 2003 18:09
To: Struts Users Mailing List
Subject: Check box problem.


Hi all,

	I am using JSPs with checkboxes(<HTML:CHECKBOX property="">) in
all the screen. As we know that an "on" (or value of checkbox) is sent
as request whenever I check the checkbox. Then what is sent when I
uncheck the checkbox??

What I observed that if I have stored the form in session and checked
2-3 check boxes. Submited the form moved onto 2nd JSP which also uses
the same form I again check 2-3 checkboxes and want to go back and
change my selection in previous screen. So I go back an change my
selection. Now my third screen displays my all selections. But it
displays the unchecked checkboxes which I checked on my second attempt.
Could any of you tell me any solution to this problem. One solution is
to define the scope of form as request and use hidden field but I cannot
use hidden fields cause number of checkboxes is not fixed.

Regards,
Ravi

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


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