• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Simple JSTL and Struts Question

 
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have the following line in my jsp page.


which renders n checkboxes,more over I use DynaActionForm.
Question: How do I know which checkbox was clicked and which one wasn't using DynaActionForm?
Thank you in advance
Garandi
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to the Struts forum.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In your action form, the property "test" should be defined as type String[]. When the form is submitted, this String array will contain a string matching the value attribute for each check box that was checked.

If you want the check boxes to be checked or unchecked based on the current value of the "test" array in the DynaActionForm, you should use the struts <html:checkboxes> tag.
 
Garandi Garandi
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Merrill,
Thank you very much for your reply, it was very useful. I change to


I see the lable for the checkboxes but not the checkbox itself, I try to use multibox I had the same problem. although I have the following line on top of my page <%@ taglib uri="/tags/struts-html-el" prefix="html" %>
In the log I get the following error
Could not complete parsing, unmatched tags: submit

Thank you
Garandi
[ May 05, 2005: Message edited by: Garandi Garandi ]
 
Garandi Garandi
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had a <br /> and that was causing problem, now it works.
Thank you
Garandi
 
Their achilles heel is the noogie! Give them noogies tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic