GeeCON Prague 2014*
The moose likes Struts and the fly likes The selected checkbox should be  checked  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "The selected checkbox should be  checked  " Watch "The selected checkbox should be  checked  " New topic
Author

The selected checkbox should be checked

shruti patel
Ranch Hand

Joined: Mar 10, 2008
Posts: 52
Hi All,

I have a JSP page in that there are checkboxes for the user to select a particular record .

As now the problem is when user has select the particular record in Page 1 and when go to Page 2 and if he come back (cutsom back button )to page 1 the selected particular is not checked.... how make it to selected...
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368
Hi shruti,

are you using ActionForm inherited form for your JSP ?


Thanks,
Shailesh
shruti patel
Ranch Hand

Joined: Mar 10, 2008
Posts: 52
yes
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368
Is that Form contains feilds for checkboxes?
If no,
Put feild for that, says checkboxArray as String Array in Form
add getter setters

while displaying checkbox on jsp,
<html:multibox name="FormName" property="checkboxArray"></html:multibox>

While going to page 2 submit page 1's form.

after that click on back button.

I hope that will work.
shruti patel
Ranch Hand

Joined: Mar 10, 2008
Posts: 52
<util:tableColumn columnClass="long" property="replaceChkBoxHeader" headerCheckBoxOnClick="selectAll()">
<nested:checkbox property="selected"/>
<nested:hidden property="id"/>
</util:tableColumn>

i am using this for check box
Fidel Edwards
Ranch Hand

Joined: Mar 19, 2008
Posts: 231
shruti patel wrote:Hi All,

I have a JSP page in that there are checkboxes for the user to select a particular record .

As now the problem is when user has select the particular record in Page 1 and when go to Page 2 and if he come back (cutsom back button )to page 1 the selected particular is not checked.... how make it to selected...


That will be better if you first set the checkbox value from your bean while going back to your page 1 !!
Hopefully That should work !!


God Gave Me Nothing I Wanted, He Gave Me Everything I Needed.
OCPJP6
 
GeeCON Prague 2014
 
subject: The selected checkbox should be checked