JSF triggers submit button unexpected
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Portal Server > JSF triggers submit button unexpected




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    JSF triggers submit button unexpected  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-27-06 01:07 PM

Hi all,

I have a JSP page. There are 2 input fields, 1 output field and 1 submit but
ton.
After I fill the second input field and presses enter, it will trigger my Ja
vaScript code and generate the value for the output field. It works well, bu
t after it triggers my JavaScript code, the cursor moves to the submit butto
n and trigger the submit bu
tton doAction unexpected.  After that it refreshes my JSP page, I lost the J
avaScript generated output value.

I use  <hx:commandExButton type="submit"
action="#{pc_ProductView.doAction}"  for my submit button.


If  I use the tab after I input the second field, it works well and doesn?t 
trigger the submit button.


How to avoid to trigger the submit button after I press the enter key for th
e input filed? I can?t ask the user uses tab key instead of enter key.


Thanks,

George






[ Post a follow-up to this message ]



    Re: JSF triggers submit button unexpected  
yurykats


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-27-06 01:07 PM

Why do you call it "unexpected"? This is the standard behavior in the browse
r - pressing Enter in a form initiates the submit as if you clicked on the S
ubmit button.

IBM has a keyboard assist jsf component - you will find it in the Properties
 view for the form. There you can define what various keys should do.





[ Post a follow-up to this message ]



    Re: JSF triggers submit button unexpected  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-27-06 01:07 PM

Hi yurykats,

Thanks a lot. It works.

George





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:36 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register