my dog learned polymorphism*
The moose likes Struts and the fly likes html:select event issue - I am not sure which event to use to remove focus Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:select event issue - I am not sure which event to use to remove focus" Watch "html:select event issue - I am not sure which event to use to remove focus" New topic
Author

html:select event issue - I am not sure which event to use to remove focus

kapil patel
Ranch Hand

Joined: Sep 30, 2005
Posts: 33
Hi friends,

We have requirements that when user clicks combo box and then enter, it should submit request.

However, when we select combo box, control is with combobox hence, I have to move focus to next element. I have created java function for that. However, my problem is following lists of events available:

onblur
onchange
onclick
ondblclick
onfocus
onkeydown
onkeypress
onkeyup
onmousedown
onmousemove
onmouseout
onmouseover
onmouseup

Out of above, only onchange event seems possible. However, when I use this event to move focus, there is another problem. If User use mouse to select value in combobox, it works fine. But still if user does not change value and hit ENTER, I have same problem.

Moreover, If some user use keyboard to scroll through value and try to select. It will move focus when he scroll one value.

I tried all combinations but failed so far. Moreover, I tried to search on internet without success. Any guidance or idea would be much appreciated.

Anybody who has face problem and any solution would be really useful.

Thanks,
Kapil Patel
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
here's something that would work:



I tried this on both Internet Explorer and FireFox, and it worked for both browsers.
[ March 08, 2007: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: html:select event issue - I am not sure which event to use to remove focus