File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Artemesia Lakener
Ranch Hand
Posts: 162
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6450
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ganesh Venkat
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use LookupDispatchActions
see
http://struts.apache.org/faqs/newbie.html
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic