[ 
https://issues.apache.org/jira/browse/MYFACES-2649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12854963#action_12854963
 ] 

Werner Punz commented on MYFACES-2649:
--------------------------------------

Ok I have to add another comment here, the problem simply is why I enforced a 
null here, that the function itself already is varargs driven which means the 
entire implicit param is:

jsf.util.chain(source, event, <functions>*) 

now there is something contradicting in the jsdoc here, on one hand the event 
is enforced, which means you have to set a dedicated value to event (null if 
you dont have anything)
on the other hand it says it is optional which means it can be the first 
parameter of the variable arguments list (the source always is enforced)

when I implemented the null check I assumed that event must be set and leaving 
it out means it has to be null,
now since we are contradicting here, and fixing it more dynamically does not 
break anything, I will change it that event is part of the varargs and an 
'undefined' event is also allowed!



> Ajax chokes on script triggered onchange if input has onchange=""
> -----------------------------------------------------------------
>
>                 Key: MYFACES-2649
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2649
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0-beta-3
>         Environment: Javascript
>            Reporter: Ganesh Jung
>         Attachments: MyFaces_Test.war
>
>
> If an ajaxified input has got onchange="" defined and a script triggers 
> input.onchange() we get an error: "event must be defined or null"
> example:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml";
>       xmlns:f="http://java.sun.com/jsf/core";
>       xmlns:h="http://java.sun.com/jsf/html";
>       xmlns:ui="http://java.sun.com/jsf/facelets";>
>       <h:head></h:head>
>       <h:body>
>               <h:form id="myForm">
>                       <h:inputText id="myTest1" value="#{myBean.test}" 
> onchange="">
>                               <f:ajax render="myTest2" />
>                       </h:inputText>
>                       <h:inputText value="#{myBean.test}" id="myTest2" />
>                       <script type="text/javascript">
>                               //<![CDATA[
>                                       
> document.getElementById("myForm:myTest1").onchange();
>                               //]]>
>                       </script>
>               </h:form>
>       </h:body>
> </html>

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

Reply via email to