This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Struts 2 multiple row delete on button click  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to delete all those rows which get selected by the checkboxlist, but i am clueless how to do it...I am very new to struts.

Also, i don't have any idea of the `name` attribute of checkboxlist, is it important? do I need to have a getter setter for that name attribute?

Kindly put some light on this...

   <td class="tabletextcont"><s:checkboxlist name="checkbox" list="functionThatGeneratesAList"/></td>
   <s:iterator value="functionThatGeneratesAList">
   <td class="tabletextcont"><s:property value="val1" /></td>
   <td class="tabletextcont"><s:property value="val2" /></td>
   <td class="tabletextcont"><s:property value="val3" /></td>
   <td class="tabletextcont"><s:property value="val4"/></td>
   <td class="tabletextcont center">
   <s:url id="deleteAllSelectedByCheckbox" action="Delete" escapeAmp="false">
   <s:param name="prop1" value="%{val1}" />
   <s:param name="prop2" value="%{val2}" />
   <s:param name="prop3" value="%{val3}" />
   <s:param name="prop4" ><s:property value="%{val4}"/></s:param>
   <s:param name="prop5" value="val4" />
   <s:a href="%{deleteAllSelectedByCheckbox}" cssClass="deleteLinks" onclick="showConfirmationBox('%{deleteAllSelectedByCheckbox}');return false;"><img alt='<s:text name="command.delete"/>' border="none" src="<s:url value="/images/delete2.gif"/>"/></s:a>
Posts: 9550
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are very new to Struts, it may be easier to take a step back and run through a tutorial so you understand what Struts is and how to use it.  
Struts is an implementation of the Front Controller Design Pattern.  The Controller fits into another pattern called Model-View-Controller.  What you shared with us is part of the "View", that is, the display portion of the application.  To actually do something, you need to configure Struts to delegate a request to an Action, which would perform some work, and a Model, which would be the data set that would be acted upon.
It's a beautiful day in this neighborhood - Fred Rogers. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!