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

Werner Punz edited comment on MYFACES-4605 at 6/23/23 6:53 AM:
---------------------------------------------------------------

Yes the id is beginning with 0. That is a "bug" in a sense that I was not aware 
that the id starts with one if the viewstate is server rendered we can change 
that easily, that must be done on all branches. I can do that at the weekend!

PS: Another possible solution would be to include the viewstate nevertheless in 
the form response that way the Viewstate in the update tag would only update 
the embedded ViewState. But that would need a small server side fix someone 
else has to perform. From the js code perspective, it makes no difference

a) No Viewstate element, the element is added at the last processing step

b) Viewstate element present in the form, only the value is updated with the 
one coming in from the tag, then also the id would not change compared to the 
embedded one.

These are the two cases which must be supported as per spec, afair.

I am not entirely sure how Mojarra behaves for this case, I guess we should be 
in sync with their response xml patterns here!

 

 

 

 


was (Author: werpu):
Yes the id is beginning with 0. That is a "bug" in a sense that I was not aware 
that the id starts with one if the viewstate is server rendered we can change 
that easily, that must be done on all branches. I can do that at the weekend!

Does not change the fact that the id can change from one response to the other 
hence you always should rely on the viewstate in the id or viewstate as name 
which is always permanent for viewstate element detection never on a permanent 
id.

(but that also can happen during server side rendering theoretically)

I will change that at the weekend accordingly. The rest I see as no bug and 
works as expected, if you all can agree as well (gave the explanation already)

PS: Another possible solution would be to include the viewstate nevertheless in 
the form response that way the viewstate in the viestate update tag would only 
update the embedded viewstate. But that would need a small server side fix 
someone else has to perform. From the js code it makes no difference

a) No Viewstate element, the element is added at the last processing step

b) Viewstate element present in the form, only the value is updated with the 
one coming in from the tag, then also the id would not change compared to the 
embedded one.

If you want to implement this option then we have 2 viewstate definitions in 
the response but also the advantage of server side id control!

Either option is fine the 0->1 fix must be added anyway, the other option wont 
break the js code!

I am not entirely sure how Mojarra behaves for this case, I guess we should be 
in sync with their response pattern here!

 

 

 

 

> 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