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

Werner Punz commented on MYFACES-4605:
--------------------------------------

Mhh I tried it in my integration testsuite by altering my multiform test:
{code:java}
// code placeholder
<h:form id="firstForm" prependId="false">
    <h:panelGroup layout="block" id="renderTarget1"/>
    <h:inputText id="first_input" value="#{multiFormBean.inputText1}"/>
    <h:commandButton id="click1" action="#{multiFormBean.doSubmit1}" 
value="submit1"
                     onclick="javascript:jsf.ajax.request(this, event, 
{execute:'firstForm', render:'panel2'}); return false;">

    </h:commandButton>
</h:form>
</h:panelGroup>
<h:panelGroup id="panel2">
<h:form id="secondForm" prependId="false">
    <h:panelGroup layout="block" id="renderTarget2"/>
    <h:inputText id="second_input" value="#{multiFormBean.inputText2}"/>
    <h:commandButton id="click2" action="#{multiFormBean.doSubmit2}" 
value="submit2"
                     onclick="javascript:jsf.ajax.request(this, event, 
{execute:'firstForm', render:'panel1'}); return false;">

    </h:commandButton>
</h:form> {code}
The test runs 100 times an alternative click either click1 or click2

and then processes the ajax response:

!image-2023-06-20-21-22-50-593.png|width=661,height=159!

 

In the end I am getting a properly updated viewstate which is identical on both 
forms.

The behavor looks correct to me! I also walked through the code, the viewstate 
of the executing form is updated as well as the viewstate of the forms in the 
render area.

This is correct behavior, as per spec!

 

 

 

 

> Cross form rending via ajax, form is missing ViewState
> ------------------------------------------------------
>
>                 Key: MYFACES-4605
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4605
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 3.0.1, 2.3.10
>            Reporter: Joe Crichton
>            Assignee: Werner Punz
>            Priority: Major
>             Fix For: 2.3.11, 3.0.3
>
>         Attachments: image-2023-06-20-21-22-50-593.png
>
>
> Seems this is an old issue, which was presumably fixed for MyFaces in 2.2 as 
> discussed here 
> [https://balusc.omnifaces.org/2011/09/communication-in-jsf-20.html#AjaxRenderingOfContentWhichContainsAnotherForm|https://balusc.omnifaces.org/2011/09/communication-in-jsf-20.html#AjaxRenderingOfContentWhichContainsAnotherForm),]
> and [https://github.com/jakartaee/faces/issues/790]
> Using openliberty with jsf-3.0 feature still has this occurring. Using the 
> workaround outlined by the first link fixes the issue. I believe the same is 
> true for the jsf-2.3 feature as well.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to