dcsimg
<logic:iterate> and <html:checkbox> example needed
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ziad_Mannan
Posted On:   Tuesday, October 15, 2002 04:29 PM

Hi, After reading through the various posts about this topic i still cant find a solid example that would help me with what i am doing. Here is the scenario: For the form I am using a DynaActionForm. I want a search page that will allow the user to choose a keyword and which fields they want to search on e.g. surname, firstname, email. So each of these options will have a checkbox next to them and the user will select the ones that s/he wants. When the user submits the form, the page that it comes back to is the same page with the keyword and the fields selected when the user submitted the form and with the search results as well. I can make this work if I set these checkboxes manually i.e. with a ta   More>>

Hi,


After reading through the various posts about this topic i still cant find a solid example that would help me with what i am doing. Here is the scenario:


For the form I am using a DynaActionForm. I want a search page that will allow the user to choose a keyword and which fields they want to search on e.g. surname, firstname, email. So each of these options will have a checkbox next to them and the user will select the ones that s/he wants. When the user submits the form, the page that it comes back to is the same page with the keyword and the fields selected when the user submitted the form and with the search results as well.


I can make this work if I set these checkboxes manually i.e. with a tag then in my action class I can get the array by doing:

form.get("fields")

But the problem with this is that when the form comes back the checkboxes are not selected anymore. So how do I do this. I know I have to use an tag and use indexed="true" in my tag but I dont quite know how to exactly do this. I need a full example. If I want to use a DynaActionForm what should go in my form defenition:


 
 


Is this correct? How exactly do I use the and tags together to get this to work.


I know this is possible but just not being able to get it right. I would really appreciate it if someone could give a full example of how to get this done.


Thanks in advance.


Ziad

   <<Less
About | Sitemap | Contact