This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes LookupDispatchAction and enter key Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "LookupDispatchAction and enter key" Watch "LookupDispatchAction and enter key" New topic
Author

LookupDispatchAction and enter key

Vicky Pandya
Ranch Hand

Joined: Dec 16, 2004
Posts: 148
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

Joined: Dec 27, 2001
Posts: 130
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.
 
subject: LookupDispatchAction and enter key
 
Similar Threads
Infinite loop using LookupDispatchAction
LookupDispatchAction Query
few questions about design struts application
LookupDispatchAction & Validation
LookupDispatchAction