0 Replies Latest reply on Feb 12, 2013 10:20 AM by Joe Greene

    rich:fileUpload widget does not call fileUploadListener in IE when using Enter key instead of mouse click

    Joe Greene Newbie

      Hello -

      We are using richfaces 3.3.3.GA in our app.

       

      We use the rich:fileUpload component, and have set the attributes so that the addControlLabel is used as text within a div (in the rendered markup) to be the face of the widget.  Using mouse clicks invokes proper widget behavior in Firefox, IE, and Chrome, which is great.  Also, we have to maintain a degree of 508 compliance, which means we have to be able to invoke the widget from the keyboard. 

       

      I have overridden the renderer and put an anchor tag inside the div, so that the invoking text is now a link so that it would respond to the Enter keystroke.  I also added an onclick handler to the <a> so that i could call click() on the "widgetid:file" component (which is the <input...> part of the widget - where all the magic happens), which is apparently what needs to receive the click.

       

      When tabbing thru the page and landing on this widget so that it has focus, clicking the Return key launches the widget in all 3 browsers as well, and I can select a file.  However, the problem arises in IE after I select the file.  When I pick the file to upload, the fileUploadListener does not get called, and so the upload does not complete.  We are using spring webflow, and I notice in my eclipse console that part of the flow is looping and looping, as if maybe the Enter keystroke event is continuing to be called?  I tried adding some cancelBubble and stopPropagation javascript to my onclick handler, but i could have done that incorrectly.

       

      Most of our users use IE, so that makes the problem even worse.  Maybe there is a lot of stuff going on behind the scenes with this component, but I'm trying to understand why there is a difference using this component between the mouse click and hitting the Enter key which calls "click()" on the widget.  Whatever the difference, it causes the fileUploadListener to not be called in IE.  The fileUpload widget works just fine for me in Firefox and Chrome.

       

      This is pretty urgent, so please, any help would be greatly appreciated.  Thank you.