struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amy Smith <>
Subject RE: How to map multiple submit actions for a single form
Date Fri, 18 Jul 2003 21:33:47 GMT
>>Hi All,
>>     I'm creating a basic struts application. In my application, I'm 
>>showing a list of products available to the user. In this page, I'm 
>>4 buttons New, Modify, Delete, Cancel. Now all these are submit buttons
>>but I'm having a single form. Now, how can I map the submit actions to 
>>different pages in struts config. I'm also attaching the jsp file. Can 
>>anyone please suggest how to solve this problem.
IMHO(Struts newbie)

I use a javascript function that changes the action for the form.

function performLookup(action) {
        document.optionsForm.action = '/sample' + action + '.do';

<html:submit property="submitButton" value="Lookup By Option Id" 
     onclick="return performLookup('/lookupByOptionId');" />

I prefer this rather than the LookupDispatchAction because server side is 
simpler and this javascript is very straight-forward.  Are there reasons 
not to do it this way?

>>    I also want to use a checkbox to select a record to perform modify 
>>delete action on the selected record. Can anyone plz tell me how to
>>achieve this??

Off topic so sent reply by email...

>>Pradeep Bhargav

-- Amy Smith    Herman Miller Information 
Technology     Software Developer
-- Computers allow you to make mistakes faster than anything with the 
possible exception of handguns and tequilla.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message