This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

LookupDispatchAction and enter key

 
Vicky Pandya
Ranch Hand
Posts: 148
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you guys handle enter keys on jsp pages when action extends LookupDispatchAction. As you know that hitting enter key on jsp page would throw and error saying no method parameter specified in action. Is there any standard way to call default action method while user hits ennter key?

I know that overriding unspecified method would resolve this but I don't want to go back to each of my action classes and override this method. any other simple way?
 
sudhakar Tadepalli
Ranch Hand
Posts: 130
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can write a javascript function to set a default value(Method Name) when you hit Enter key(KeyCode==13).But I doubt one thin what if you focus a button with tab and hit eneterkey ?. Techincally it should call the selected method. If you convert your submit buttons to just button and submit through javascript will works for all. Not sure if it help u
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic