Inside JobObjects bean, add one attribute for checking if this job is
checked, say selectedFlag (Not a good name). Set the value of
selectedFlag to true for all the JobObjects which you want to show as
selected.This you can do in the action class which forwards to this JSP.
While creating the checkboxes, first check if selectedFlag for that
JobObjects is true then display the checkbox as selected.This can be
done using logic:equal tag.

*********************************************************
RAHUL K. SAXENA
Sr. Systems Engineer,
Wipro Technologies,
Ground Floor, Tower II,
72, Electronic City,
Hosur Main Road,
Bangalore-561 229, India.
Ph: 91-80-8520408/416(x-2026)
*********************************************************

-----Original Message-----
From: Rick Reumann [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 08, 2002 8:33 PM
To: Struts List
Cc: [EMAIL PROTECTED]
Subject: marking checkboxes checked from a List


I'm sure there is a good way to handle this in Struts but me being the
dumbass I thought I'd ask for help:

Picture a case where you display a list of "jobs" -
where next to each job name is a checkbox (Just using jobs for this
example). Each checkbox corresponding to the job will have a value that
is a String (jobAbbreviation). Displaying this list of jobs and the
value of the checkboxes isn't a problem ( populated from an ArrayList of
JobObjects ).

The problem is:

How do I mark the correct checkboxes based on an ArrayList of Strings
(jobAbbreivations)? In other words I have just a List of Strings and I
need to mark all the appropriate checkboxes that have the same values as
this List of abbreviations. ( I know an ugly way to do it using java in
the JSP page checking each value to see if it's in the List but there
must be a cleaner way ).

Thanks so much for any help.

-- 

Rick
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

**************************Disclaimer************************************

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***************************************************************************

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to