[jira] [Commented] (MYFACES-4605) Cross form rending via ajax, form is missing ViewState
[ https://issues.apache.org/jira/browse/MYFACES-4605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17727569#comment-17727569 ] Melloware commented on MYFACES-4605: [~werpu] maybe something for you to investigate or validate? > 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 >Reporter: Joe Crichton >Priority: Major > > 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)
[jira] [Commented] (MYFACES-4605) Cross form rending via ajax, form is missing ViewState
[ https://issues.apache.org/jira/browse/MYFACES-4605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17727576#comment-17727576 ] Volodymyr Siedlecki commented on MYFACES-4605: -- I agree with Melloware. Looks like there's a TCK app here: [https://github.com/jakartaee/faces/blob/1d71aae51f7d5ae684a3f43db0521b7e7e6aa4f6/tck/faces23/ajax/src/main/webapp/spec790.xhtml] > 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 >Reporter: Joe Crichton >Priority: Major > > 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)
[jira] [Commented] (MYFACES-4605) Cross form rending via ajax, form is missing ViewState
[ https://issues.apache.org/jira/browse/MYFACES-4605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17727596#comment-17727596 ] Werner Punz commented on MYFACES-4605: -- I will have a look on it on Thursday, I assume it only is broken for MyFaces 3.x but not for the new codebase in 4.0! > 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 >Reporter: Joe Crichton >Priority: Major > > 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)
[jira] [Commented] (MYFACES-4605) Cross form rending via ajax, form is missing ViewState
[ https://issues.apache.org/jira/browse/MYFACES-4605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17732725#comment-17732725 ] Werner Punz commented on MYFACES-4605: -- Sorry for the delay, I will start with this issue tomorrow, this bug should only affect the 2.3 and 3.0 versions of the code, 4.0 definitely does not have it, I spent a ton of time on 4.0 to get this right and spec conform! Cross form submit I think either was introduced in 2.2 or 2.3 cannot remember anymore (aka have to look that up)! Before that we had a config parameter which enforced that the forms were all updated at once! > 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 >Reporter: Joe Crichton >Assignee: Werner Punz >Priority: Major > > 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)
[jira] [Commented] (MYFACES-4605) Cross form rending via ajax, form is missing ViewState
[ https://issues.apache.org/jira/browse/MYFACES-4605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17733005#comment-17733005 ] Melloware commented on MYFACES-4605: [~werpu] thanks for looking into this! > 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 >Reporter: Joe Crichton >Assignee: Werner Punz >Priority: Major > > 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)
[jira] [Commented] (MYFACES-4605) Cross form rending via ajax, form is missing ViewState
[ https://issues.apache.org/jira/browse/MYFACES-4605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17733216#comment-17733216 ] Werner Punz commented on MYFACES-4605: -- I am starting now to work on it, expect a fix early/mid next week. > 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 > > > 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)
[jira] [Commented] (MYFACES-4605) Cross form rending via ajax, form is missing ViewState
[ https://issues.apache.org/jira/browse/MYFACES-4605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17733231#comment-17733231 ] Werner Punz commented on MYFACES-4605: -- Small update: The code should work, the code branch which deals with this issue is following: {code:java} // code placeholder var childForms = this._Dom.findByTagName(currNode, "form"); if(childForms && childForms.length) { for(var cnt = 0; cnt < childForms.length; cnt++) { if(childForms[cnt].id) { mfInternal._updateForms.push(childForms[cnt].id); } } } {code} the updateForms later are processed after the insertion is done to update the viewstate which comes in its own response tag. I will need to investigate why this fails. Either way thanks for reporting this. I will keep you in the loop! > 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 > > > 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)
[jira] [Commented] (MYFACES-4605) Cross form rending via ajax, form is missing ViewState
[ 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 {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)
[jira] [Commented] (MYFACES-4605) Cross form rending via ajax, form is missing ViewState
[ https://issues.apache.org/jira/browse/MYFACES-4605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17735808#comment-17735808 ] Joe Crichton commented on MYFACES-4605: --- Here is a simple two form two button case: {noformat} http://www.w3.org/1999/xhtml"; xmlns:f="http://xmlns.jcp.org/jsf/core"; xmlns:h="http://xmlns.jcp.org/jsf/html"; xmlns:ui="http://xmlns.jcp.org/jsf/facelets"; xmlns:jsf="http://xmlns.jcp.org/jsf"; xmlns:c="http://java.sun.com/jsp/jstl/core"; xmlns:o="http://omnifaces.org/ui"; xmlns:pt="http://xmlns.jcp.org/jsf/passthrough";> Carbon Title http://www.w3.org/1999/xhtml"; xmlns:carbon="http://java.sun.com/jsf/composite/carbon";> if(window.PrimeFaces){PrimeFaces.settings.locale='en_US';PrimeFaces.settings.viewId='/joetest.xhtml';PrimeFaces.settings.contextPath='/technologyconnect';PrimeFaces.settings.cookiesSecure=false;} Carbon Title myfaces.config._autoeval = true; {noformat} When I press the first button, this is what I see come back from the post, so it actually updates j_id__v_0:jakarta.faces.ViewState:1, and does not include the viewstate in the 2nd form being rendered {noformat} {noformat} However, after the jsf update completes, the 2nd form DOES have a viewstate value listed with id of j_id__v_0:jakarta.faces.ViewState:0 (different than anything seen thus far). {noformat} {noformat} So maybe a wild goose chase (sorry). The original issue was an error case I had caused during the conversion to Jakarta JSF 3.0 dealing with Omnifaces. When I fixed my name space issue, the code was working, using the Balusc workaround for 2nd form viewstate fixup. > 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)
[jira] [Commented] (MYFACES-4605) Cross form rending via ajax, form is missing ViewState
[ https://issues.apache.org/jira/browse/MYFACES-4605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17735872#comment-17735872 ] Werner Punz commented on MYFACES-4605: -- Ok now I have gotten it, this is a server side "issue", I was only looking on my part, the ajax code. The behavior is not incorrect per se, but might not be ideal for some cases, better for others. First of all the view state is not embedded but it is handled as its own response tag. This is allowed by the spec, in a multiform case the executing form and the form containing the rendered elements get updated viewstates. To handle this is basically that you pass the viewstate as separate response tag and let the client resolve this in the javascript code. Theoretically you also could render the viewstate in the form in the response, but you need to pass it separately anyway because also the issuing form needs to be updated. I guess myfaces simply has skipped this to avoid double view state definitions in the reponse. Again I don´t think this is a bug, because the post processing must be done anyway, you wont lose any performance. Second: The reason why the id changes is simply following: The id is not important except for some internal processing, but must be unique, at submit the jakarta.faces.ViewState name is passed as key. But the id must be set and must include the viewroot identifier, the number at the end is just basically an incrementing number so that the id is unique in the entire page. Again the spec leaves it open what you do with this number in the end, the end result must be simply a unique id! Either way, in the end you will have a proper consistent state after rendering with the viewstates being updated in both forms, but if you look into the response you might not have the viewstates embedded in the form. Again I think this is correct behavior! Someone else might chime in and correct me on this. > 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)
[jira] [Commented] (MYFACES-4605) Cross form rending via ajax, form is missing ViewState
[ https://issues.apache.org/jira/browse/MYFACES-4605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17735918#comment-17735918 ] Volodymyr Siedlecki commented on MYFACES-4605: -- Looks like the new viewstate id is caused by _fetchUniqueId: function(prefix, identifier) { var cnt = 0; var retVal = prefix + identifier + jsf.separatorchar + cnt; while(this._Dom.byId(retVal) != null) { cnt++; retVal = prefix + identifier + jsf.separatorchar + cnt; } return retVal; }, The count starts at 0, and the evaluation sees that 0 is available, so it uses it. The Java code starts the id with 1 : {color:#dcdcaa}HtmlResponseStateManager{color} if (count == null) { count = Integer.valueOf(0); } count += 1; > 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)
[jira] [Commented] (MYFACES-4605) Cross form rending via ajax, form is missing ViewState
[ https://issues.apache.org/jira/browse/MYFACES-4605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17736367#comment-17736367 ] Werner Punz commented on MYFACES-4605: -- 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) > 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)
[jira] [Commented] (MYFACES-4605) Cross form rending via ajax, form is missing ViewState
[ https://issues.apache.org/jira/browse/MYFACES-4605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17737814#comment-17737814 ] Werner Punz commented on MYFACES-4605: -- Have issued a fix for the id :0 problem for myfaces 4.0 which will be merged today. Will issue a fix for the 2.x and 3.x branches later this week! > 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)