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

Werner Punz commented on MYFACES-2585:
--------------------------------------

Ok this is a huge problem, but not on the javascript side, the problem lies in 
the way JSF handles the update part
The example maps roughly to following return string

<?xml version="1.0" encoding="utf-8"?><partial-response><changes><update 
id="myForm:myText"><![CDATA[<span id="myForm:myText"><input 
id="myForm:j_id2076757786_7bc8cfb1" name="myForm:j_id2076757786_7bc8cfb1" 
type="text" value="aaaaa" />
 <script type="text/javascript"><!--

 //<![CDATA[
 alert("hello");
 //]]>

//--></script></span>]]></update><update 
id="javax.faces.ViewState"><![CDATA[wAKfV4bepmBnyfeFWNCSN/IhViyGgobTvdAEvn4nKBrg3X2hhH9sIxBOFwn10jm/kEIjlw3aaS7jiAxqIC4TXvmOedIbj9MG]]></update></changes></partial-response>

As you can see the problem is in the syntax itself since the spec states that 
the update block must be a CDATA block, but now we have a cdata within a CDATA 
block which is a huge problem, we either can fix it on the facelets side, or on 
the responsewriter side. Another option probably would be a script component 
which filters the CDATA out...



> ajax doesn't work if target contains script with CDATA
> ------------------------------------------------------
>
>                 Key: MYFACES-2585
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2585
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0-beta-2
>         Environment: Javascript
>            Reporter: Ganesh Jung
>
> This doesn't work:
>               <h:inputText value="#{numberBean.myNumber}">
>                               <f:ajax render="test" />
>               </h:inputText>
>               <h:panelGroup id="test">
>                           <script type="text/javascript">
>                               //<![CDATA[
>                                       alert("running");
>                                       //]]>
>                               </script>
>                       <h:inputText value="#{numberBean.myNumber}" />
>               </h:panelGroup>
> But this works fine:
>               <h:inputText value="#{numberBean.myNumber}">
>                               <f:ajax render="test" />
>               </h:inputText>
>               <h:panelGroup id="test">
>                           <script type="text/javascript">
>                                       alert("running");
>                               </script>
>                       <h:inputText value="#{numberBean.myNumber}" />
>               </h:panelGroup>

-- 
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