File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes I want two buttons on a page, one for Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "I want two buttons on a page, one for "search refine", one for "submit", how to do ?" Watch "I want two buttons on a page, one for "search refine", one for "submit", how to do ?" New topic
Author

I want two buttons on a page, one for "search refine", one for "submit", how to do ?

Artemesia Lakener
Ranch Hand

Joined: Jun 21, 2005
Posts: 162
On one JSP page, I have a very long list of items. So I want a "search" button (and a search text field of course) to filter information, when user hits this button the page will be refreshed and display the filter item list. When user hits the "submit" button, it should directly go to next functional page without doing any further "search".

But it seems a FORM can only handle one button, how do I accomplish this two tasks on one JSP page using struts ?
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Originally posted by Artemesia Lakener:
But it seems a FORM can only handle one button, how do I accomplish this two tasks on one JSP page using struts ?


This is a good question and one that is frequently asked. I suggest searching this forum as there are many threads which address this issue.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

A form can have multiple buttons. There is more than one way to handle multiple buttons. One is to check in the Action class which button was selected (and there are multiple tricks for determining this). Another way is to use DispatchActions.

As Jason said, there are plenty of resources on that topic here to search through. I hope you can use key words from my post to refine your search. If you have trouble let us know.


A good workman is known by his tools.
Ganesh Venkat
Greenhorn

Joined: Jul 19, 2005
Posts: 2
Use LookupDispatchActions
see
http://struts.apache.org/faqs/newbie.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I want two buttons on a page, one for "search refine", one for "submit", how to do ?