aspose file tools*
The moose likes Struts and the fly likes Precheck the CheckBox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Precheck the CheckBox" Watch "Precheck the CheckBox" New topic
Author

Precheck the CheckBox

Mamta Nayyar
Greenhorn

Joined: Jan 20, 2005
Posts: 2
I have array of checkboxes in my JSP.I want to check some of them on some predefined condition with the loading of the page.

<html:checkbox property="funcSelect" value="&dynamic value"/>

funcSelect is the Formbean variable of the type String[] which have both getter and setter in the formbean.

Dynamic values of value: It have the value populating from the database.
Paul Wong
Greenhorn

Joined: Aug 14, 2002
Posts: 16
Have a look at this. I think it's what you're looking for
http://struts.apache.org/faqs/indexedprops.html


SCJP, SCJD , SCBCD, SCMAD, SCDJWS, SCEA
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
create a String[] of the values for the checkboxes you want to pre-select and do a form.set("formCheckBoxes", theStringArray); in your Action.execute() BEFORE forwarding to the display page. 'form' is the local reference to the ActionForm referenced by the action.


-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Precheck the CheckBox
 
Similar Threads
prevention of default value considered in the jsp page??
dynamic java beans for the same JSP ?
How to crate Multiple ArrayList from one ArrayList
show message from resource file.
Action Class - Thread safe