Issue Details (XML | Word | Printable)

Key: ICE-5536
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mircea Toma
Reporter: Deryk Sinotte
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ICEfaces

The action method of two components are called when Enter key is pressed

Created: 23/Mar/10 12:02 PM   Updated: 03/Jan/11 04:18 PM
Component/s: Bridge, Components, Framework
Affects Version/s: 2.0-Alpha2
Fix Version/s: 2.0-Beta2, 2.0.0

Environment: ICEfaces 2 Compatibility
Issue Links:
Dependency
 
Duplicate
 

ICEsoft Forum Reference: http://www.icefaces.org/JForum/posts/list/16412.page


 Description  « Hide
Given a simple test case like this:

<ice:form>
    <ice:inputText value="BLAH" action="#{simple.textAction}"/><br/>
    <ice:commandButton value="Click" action="#{simple.buttonAction}"/><br/>
</ice:form>

If you focus the inputText field and hit the Enter key, the action methods of both the inputText component and the commandButton are called. This behaviour is different from ICEfaces 1.8 where only the action of the inputText field would be called.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Ted Goddard added a comment - 23/Mar/10 12:06 PM
Standard browser behavior is to click on a random button within the form to submit via enter key. This is not the behavior of ICEfaces 1.x, so we should describe that mechanism (likely JavaScript implementation) here.

Mircea Toma added a comment - 09/Apr/10 09:59 AM
The fix for ICE-5574 solved this issue. Now the enter key press is captured in the form element, the element that triggered the event is used when ice.submit is invoked. This way only the triggering element is serialized along with the rest of the form non-submitting elements.

Deryk Sinotte added a comment - 18/Aug/10 10:46 AM
Re-opening as the behaviour is back. Create a simple compat page with the code in the description, you can see both actions being called when the Enter key is pressed while focus is in the inputText field.

Mircea Toma added a comment - 08/Sep/10 09:21 AM - edited
Modified ice.s and ice.ss functions to cancel the default action when enter key is pressed. This way the event won't trigger a form submit anymore.