You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Volker Malzahn (JIRA)" <de...@myfaces.apache.org> on 2010/03/31 15:20:27 UTC

[jira] Commented: (TRINIDAD-354) Using autoSubmit on a text field suppresses the ActionEvent on a button

    [ https://issues.apache.org/jira/browse/TRINIDAD-354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851855#action_12851855 ] 

Volker Malzahn commented on TRINIDAD-354:
-----------------------------------------

I have found a work around for this issue in our webapp:
Instead of specifying autoSubmit="true" on tr:inputText etc. I specify my own onchange handler controlASOnChange.
Inside the JavaScript function controlASOnChange I delay the execution of the autoSubmit logic by window.setTimeout("autoSubmit('" + controlId + "', '" + formId + "')", 100);
My autoSubmit function then calls the Trinidad autoSubmit function: TrPage._autoSubmit(formId, controlId, new Object(), 1);
"new Object()" is taken as event. TrPage._autoSubmit is able to deal with this instead of the real onchange event.

By delaying the autoSubmit processing by 100ms the click event (which waits for execution in the queue) wins against the onchange event in my environment (tested with IE8 and Firefox 3.6).

This is no real solution of the issue but more a work around. I hope that Trinidad will have a general solution for it in a future release.

Regards,
Volker

> Using autoSubmit on a text field suppresses the ActionEvent on a button
> -----------------------------------------------------------------------
>
>                 Key: TRINIDAD-354
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-354
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 1.0.1-incubating-core-SNAPSHOT
>            Reporter: Adam Winer
>
> First reported on OTN for ADF Faces:
> http://forums.oracle.com/forums/thread.jspa?threadID=390427&tstart=0
> ... but presumably applies to Trinidad too.  The report:
> "Adding an InputText component on the page that has autosubmit set to true and
> a value change listener attached will suppress a button action event if the
> user directly clicks onto the button when leaving the field
> To reproduce:
> - Create ADF Faces page with backing bean
> - Add InputText components to ADF Faces page
> - Set autosubmit property in the InputText to true
> - Add CommanButton to ADF Faces page
> - Create action method for command button (double click on the button to
> create the method
> - Add System.out.println("Action event fired"); into the method
> - create a ValueChange listener for the textfield and put
>   System.out.println("Value Change Listener fired"); into it
> - Run the ADF Faces page
> - Type hello into teh textfield and hit the button
> The output you see is "Value Change Listener fired". Pressing the button
> twice shows "Action event fired" as well. Obviously an event on a autosubmit
> InputText overrides the event on the component that is clicked on."

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.