Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 3.1.0.RC1
-
Fix Version/s: 3.1, EE-3.0.0.GA_P01
-
Component/s: Sample Apps
-
Labels:None
-
Environment:Icefaces3/trunk revision# 28883
Server: tomcat6
Browser: IE7/8 (may be in other IE browsers)
-
Assignee Priority:P1
Description
In the component-showcase sample app - Autocomplete page:
The tests pass, however there is a java.lang.NumberFormatException that occurs in the tomcat log when selecting a value from the autocomplete list if using the keyboard (not occurring in the other browsers, or when selecting the value with the mouse).
java.lang.NumberFormatException: For input string: "undefined"
at java.lang.NumberFormatException.forInputString(NumberFormatException.
java:48)
at java.lang.Integer.parseInt(Integer.java:447)
at java.lang.Integer.parseInt(Integer.java:497)
at com.icesoft.faces.component.ext.KeyEvent.getKeyCode(KeyEvent.java:95)
at com.icesoft.faces.component.selectinputtext.SelectInputText.queueEven
tIfEnterKeyPressed(SelectInputText.java:584)
at com.icesoft.faces.component.selectinputtext.SelectInputText.decode(Se
lectInputText.java:123)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.
java:1181)
at javax.faces.component.UIInput.processDecodes(UIInput.java:662)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.
java:1176)
..............
The tests pass, however there is a java.lang.NumberFormatException that occurs in the tomcat log when selecting a value from the autocomplete list if using the keyboard (not occurring in the other browsers, or when selecting the value with the mouse).
java.lang.NumberFormatException: For input string: "undefined"
at java.lang.NumberFormatException.forInputString(NumberFormatException.
java:48)
at java.lang.Integer.parseInt(Integer.java:447)
at java.lang.Integer.parseInt(Integer.java:497)
at com.icesoft.faces.component.ext.KeyEvent.getKeyCode(KeyEvent.java:95)
at com.icesoft.faces.component.selectinputtext.SelectInputText.queueEven
tIfEnterKeyPressed(SelectInputText.java:584)
at com.icesoft.faces.component.selectinputtext.SelectInputText.decode(Se
lectInputText.java:123)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.
java:1181)
at javax.faces.component.UIInput.processDecodes(UIInput.java:662)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.
java:1176)
..............
The issue is caused by the false detection of the event type. Before submit the captured events are wrapped so that they provide a uniform API, regardless of the browser type. The detection of IE events was relying on the missing of the Event.preventDefault() method but Prototype is creating this method, trying to provide a common API based on the Netscape event API.
The fix modifies the IE event detection by using Event.srcElement property instead of Event.preventDefault() method.