Struts - multiple actions for same checkboxes

G

GuyBrush Treepwood

I'm using Struts to build a webapplication. Below is a snippet of code
from one of my jsp pages displays the folders of a user. In front of each
folder is a checkbox, so that all checked folders can be deleted at once.
I'm wondering, is it possible to have more than 1 submit button,
performing different actions on the same checkboxes. Like having a delete
button and an edit button.

<html:form action="/service/deleteFolders" method="POST">
<fieldset>
<ul id="folders">
<logic:iterate id="folder" name="folderList" >
<li>
<html:multibox name="treeLevelBean" property="checkedFolders" >
<bean:write name="folder" property="folderId" />
</html:multibox>

<html:link page="/service/showTreeLevel.do"
paramId="currentFolderId" paramName="folder"
paramProperty="folderId">
<bean:write name="folder" property="foldername"/>
</html:link>
</li>
</logic:iterate>
</ul>

<html:submit value="Delete" />
</fieldset>
</html:form>
 
W

Wendy Smoak

GuyBrush Treepwood said:
I'm wondering, is it possible to have more than 1 submit button,
performing different actions on the same checkboxes. Like having a delete
button and an edit button.

Sure. A submit button is just another form element. While HTML purists
will say that a form should have at most one submit button, that's not the
way things turn out in the real world. :) One of the flavors of
DispatchAction might be useful here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,733
Latest member
LonaMonzon

Latest Threads

Top