We're using (client-side) javascript to perform the submit to the proper
action class. So, for example, here's a coupla' buttons on the same form:
<input type="Button" name="Save"
value="Save"
onClick='javascript:doSubmit("SaveCustomer.do")'>
<input type="Button" name="New"
value="New"
onClick='javascript:doSubmit("NewCustomer.do")'>
And here's the javascript for the submit/click:
function doSubmit(myAction) {
document.forms.query.submit(myAction)
}
I'm *definitely* curious as to how others are doing this....
HTH,
Mike
At 4/19/2000 10:34 AM -0400, Seibert, Dan wrote:
>Hi all,
>
>We are designing a new enterprise app and are sold on the
>jsp-servlet-bean/ejb model 2 approach. I am working on some prototypes to
>figure out some of the details. I have been following the
>Kevin/Craig/Dan/et.al Model 2 architecture thread very closely and applying
>the techniques discussed to my prototype. I have a couple of details to
>throw out to the crowd.
>
>* Some of our forms have multiple submit buttons for a single form
>(ex. Save, Delete, Find, Add, Remove, etc). My dilemma here is if I have one
>action per form, my actions are not as specific as I would like them to be.
>(Having FindCustomer and SaveCustomer handled by the same action). What I
>have tried in the prototype is giving the buttons the same NAME (Button)
>and assigning different VALUES (Find,Save,Delete). My controller servlet
>then retrieves the Button value into a prefix (prefix =
>request.getParameter("Button") ) and adds the prefix to the URL. So
>"/Customer.do" becomes a "SaveCustomer" or "FindCustomer" action. Then use
>this action in the Hashtable/Property List to get the specific action class.
>
> Am I way off base here? Is there a more straightforward approach?
>Are there some drawbacks I'm missing?
>
>* Also, we have multi-page forms using a "Next" button. However, we
>also provide tabs along the top to give the user the flexibility to go to
>the pages in any order. My problem here is keeping the complexity down for
>determining the Next page in the Action class. I've batted around a few
>different solutions which all seem to have their own drawbacks. The one I
>like best today also uses the value of "Button": Have the Button value take
>the form of action.nextpageKey (Next.Order, Next.DestinationAddress, etc)
>where "Next" is the prefix to apply to the URL as described above, and
>"Order" is the key into my HashTable/PropertyList to find the next page in
>the "happy" scenario.
> What I don't like about this is that I'm relying too heavily on the
>value of Button for multiple purposes.
>
>
>Any suggestions or comments are appreciated.
>
>Thanks,
>Dan
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets