RE: How to map multiple submit actions for a single form

2003-07-18 Thread Witbeck, Shane
Take a look at LookupDispatchAction

-Original Message-
From: pradeep bhargav [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 17, 2003 11:54 PM
To: [EMAIL PROTECTED]
Subject: How to map multiple submit actions for a single form


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 having
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.

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

Regards,

Pradeep Bhargav



=

pradeepbhargav
JCE CIVIL GROUP
MatrixOne India
Scandent Group
[EMAIL PROTECTED]




__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to map multiple submit actions for a single form

2003-07-18 Thread Sandeep Takhar
Lots of ways, but best to read more about them..

1. LookupDispatchAction
2. You can have different forms for each of them quite
easily.
3. Cancel should be an html:cancel and you can check
(preferabbly in a BaseAction) if isCancelled(request).
4. Can have an action that one form points to and just
have this (preferrably in a baseAction)
if (request.getParameter(button_Name_delete)
{
   deleteAction
}
Note that this is similar to LookupDispatchAction.

sandeep
--- pradeep bhargav [EMAIL PROTECTED] wrote:
 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 having
 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.
 
 I also want to use a checkbox to select a record
 to perform modify or 
 delete action on the selected record. Can anyone plz
 tell me how to
 achieve this??
 
 Regards,
 
 Pradeep Bhargav
 
 
 
 =
 
 pradeepbhargav
 JCE CIVIL GROUP
 MatrixOne India
 Scandent Group
 [EMAIL PROTECTED]
 
 
 
 
 __
 Do you Yahoo!?
 SBC Yahoo! DSL - Now only $29.95 per month!
 http://sbc.yahoo.com
 
-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
[EMAIL PROTECTED]


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How to map multiple submit actions for a single form

2003-07-18 Thread Amy Smith
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 
having
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 
or 
delete action on the selected record. Can anyone plz tell me how to
achieve this??


Off topic so sent reply by email...

Regards,

Pradeep Bhargav


-- Amy Smith[EMAIL PROTECTED]Herman Miller Information 
Technology Software Developer
-- Computers allow you to make mistakes faster than anything with the 
possible exception of handguns and tequilla.

RE: How to map multiple submit actions for a single form

2003-07-17 Thread Ravi Garg
Hi Praadep,

Whenever you click on any of the button then you can call some
javascript function. In that funct you can write ..

document.formname.action =abc;
document.formname.submit();
So now your form gets submitted and the logical address given by it is
abc. There must be according mapping in struts-config.xml for this
logical name.
So in this way you can change your action on click of each button and
submit the form.

Regards,
Ravi

-Original Message-
From: pradeep bhargav [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 18, 2003 9:24 AM
To: [EMAIL PROTECTED]
Subject: How to map multiple submit actions for a single form

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
having
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.

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

Regards,

Pradeep Bhargav



=

pradeepbhargav
JCE CIVIL GROUP
MatrixOne India
Scandent Group
[EMAIL PROTECTED]




__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]