myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Werner Punz (JIRA)" <>
Subject [jira] Commented: (MYFACES-2649) Ajax chokes on script triggered onchange if input has onchange=""
Date Thu, 08 Apr 2010 15:40:36 GMT


Werner Punz commented on MYFACES-2649:

Ok after checking the problem and investigating the spec, this is a bug in our implementation,
according to the jsdocs of the spec it says:
<static> jsf.util.chain(source, event)

A varargs function that invokes an arbitrary number of scripts. If any script in the chain
returns false, the chain is short-circuited and subsequent scripts are not invoked. Any number
of scripts may specified after the event argument.

    The DOM element that triggered this Ajax request, or an id string of the element to use
as the triggering element.
    The DOM event that triggered this Ajax request. The event argument is optional. 

Now your case causes an undefined value for the event object, which is according to the jsdocs
valid, and should not raise an error, I will fix this immediately.

> Ajax chokes on script triggered onchange if input has onchange=""
> -----------------------------------------------------------------
>                 Key: MYFACES-2649
>                 URL:
>             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"
>         "">
> <html xmlns=""
>       xmlns:f=""
>       xmlns:h=""
>       xmlns:ui="">
> 	<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.

View raw message