• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Precheck the CheckBox

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at this. I think it's what you're looking for
http://struts.apache.org/faqs/indexedprops.html
 
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic