WebSphere Portal Server - JSF triggers submit button unexpected

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > April 2006 > JSF triggers submit button unexpected





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author JSF triggers submit button unexpected

2006-04-27, 8:07 am

Hi all,

I have a JSP page. There are 2 input fields, 1 output field and 1 submit button.
After I fill the second input field and presses enter, it will trigger my JavaScript code and generate the value for the output field. It works well, but after it triggers my JavaScript code, the cursor moves to the submit button and trigger the submit bu
tton doAction unexpected. After that it refreshes my JSP page, I lost the JavaScript 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 the input filed? I can?t ask the user uses tab key instead of enter key.


Thanks,

George

yurykats

2006-04-27, 8:07 am

Why do you call it "unexpected"? This is the standard behavior in the browser - pressing Enter in a form initiates the submit as if you clicked on the Submit 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.

2006-04-27, 8:07 am

Hi yurykats,

Thanks a lot. It works.

George
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com