It's not a secret anymore!
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "LookupDispatchAction and enter key" Watch "LookupDispatchAction and enter key" New topic

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
I agree. Here's the link:
subject: LookupDispatchAction and enter key
It's not a secret anymore!