Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

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

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use LookupDispatchActions
see
http://struts.apache.org/faqs/newbie.html
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic