Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3-next-M8
-
None
-
None
Description
Steps to reproduce:
- create xhtml with f:param and f:ajax onevent like this:
<h:form prependId="false"> <h:commandLink action="#{sampleBean.doAction}"> <h:outputText value="Click Me!"/> <f:param name="var1" value="NEW VALUE"/> <f:ajax event="click" execute="@this" onevent="testJs"> </f:ajax> </h:commandLink> </h:form> <script> //<![CDATA[ function testJs(data) { if (data.status === 'success') { alert("Success click") } } //]]> </script>
- click on "Click me"
- get an error in the console: "Uncaught SyntaxError: Unexpected token ':' (at index.xhtml:9:868)"
The reason:
Generated page code by M7 build:
jsf.util.chain(this, event,function(event){myfaces.ab(this,event,'click','j_id_i','',{'onevent':testJs,'var1':'NEW VALUE'})}); return false;
Generated page code by M8 build with bad JS (look at testJsparams):
jsf.util.chain(this, event,function(event){myfaces.ab(this,event,'click','j_id_i','',{'onevent':testJsparams:{'var1':'NEW VALUE'}})}); return false;
I've attached an archive with an example.