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

Werner Punz commented on MYFACES-2599:
--------------------------------------

Ok mojarra.ab does probably some preprocessing dividing between the issuing 
component and the execute.

I am not even sure if plain f:ajax is allowed to render something else than a 
call to javax.faces.request, I have to check the documentation for that.
With my bypass code, which I will commit tomorrow a call 
javax.ajax.request(this, should go through even if the component is detached 
but only if you have a reference to the node itself not its identifier.

And if the name of the replacement control is identical to what the original 
control would have passed (which should be 
as far as I know dijit) then the value also is properly passed from the right 
form in a multiform environment.

I however cannot cover the case of jsf.ajax.request("testForm:test", ....), if 
testForm:test is detached because
then I only have a string identifier and  cannot get the dom node issuing the 
request anymore and the spec 
then forces me to issue an error (see the jsdoc reference I posted above).

So my second guess in mojarra ab is that it internally isses a request 
jsf.ajax.request(this, ..., execute:"testForm:test") to cover that.

But as I said it comes down to what is allowed on the <f:ajax> renderers side, 
whether this is valid or not, if it is valid we definitely 
could some rewriting of the f:ajax renderer to cope with that behavior in a 
similar manner (although I doubt wrapping it yet in another utils function is 
needed here))

But also have in mind that the second problem is that the request with your 
example might not throw any error but
also wont give you any result, because the state is not yet finalized, if 
mojarra.ab triggers a timeout internally than this is resolved
if not it will issue the xhr request but will more or less get an empty control 
for not having the viestate. But that is more an issue
of the testcase and less one of the implementation :-)




> ajax javascript checks for existence of triggering html element
> ---------------------------------------------------------------
>
>                 Key: MYFACES-2599
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2599
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0-beta-2
>         Environment: Javascript
>            Reporter: Ganesh Jung
>
> This one is a bit special. I remove the triggering element from the DOM, 
> afterwards I trigger it's onchange method. Works with Mojarra, but MyFaces 
> insists, that the triggering element must exist in the DOM, though this isn't 
> necessary from the spec.
>               <h:form id="testForm">
>                       <h:inputText id="test" value="#{myBean.test}" >
>                               <f:ajax render="test2"/>
>               </h:inputText>
>                       <h:inputText id="test2" value="#{myBean.test}" />
>                   <script type="text/javascript">
>                               //<![CDATA[
>                       var myTest = document.getElementById("testForm:test");
>                       var test_onchange = myTest.onchange;
>                       myTest.parentNode.removeChild(myTest);
>                       test_onchange();
>                               //]]>
>                       </script>
>               </h:form>

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