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

Werner Punz edited comment on MYFACES-4533 at 1/20/23 5:47 PM:
---------------------------------------------------------------

I just ran the test against mojarra here is the result

 
{code:json}
j_id1:form1=j_id1:form1
j_id1:jakarta.faces.ViewState=5807784481578067120:-3902354252644387665
j_id1:jakarta.faces.source=j_id1:form1:button
j_id1:jakarta.faces.partial.event=click
j_id1:jakarta.faces.partial.execute=j_id1:form1:button j_id1:form1
j_id1:jakarta.faces.partial.render=j_id1:panel2 j_id1:panel3
j_id1:jakarta.faces.behavior.event=action
j_id1:jakarta.faces.partial.ajax=true

{code}
 Ok they basically prefixed everything except for the non standard 
j_id1:form1=j_id1:form1 (which I had to take in to keep mojarra compatibility 
with my implementation)

So this means... in case of a naming container we really have to prefix 
everything, and also
the execute has the button in its cycle independent of being part of the 
executes list because it is the source!

The question remains as @volosied mentioned that at the encoding stage we do 
not have the naming container name present.
I think this is solvable simply by check our ViewState elements.
There is no other case where the ViewState element name is prefixed, unless it 
is in a named naming container!

 ---
Hi I managed to pull of a preliminary working client script version in the link 
to my github branch 
(https://github.com/werpu/myfaces/tree/feature/MYFACES-4466-TCK790), which 
behaves the same as mojarra regarding the prefixes:
{code:json}
j_id__v_0:form_SUBMIT=1
j_id__v_0:jakarta.faces.ViewState=Zjc1YmUxYzI0ZjU2YzFiOTAwMDAwMDAx
j_id__v_0:jakarta.faces.ViewState=Zjc1YmUxYzI0ZjU2YzFiOTAwMDAwMDAx
j_id__v_0:jakarta.faces.behavior.event=action
j_id__v_0:jakarta.faces.partial.event=click
j_id__v_0:jakarta.faces.source=j_id__v_0:form:button
j_id__v_0:jakarta.faces.partial.ajax=true
j_id__v_0:form=j_id__v_0:form
j_id__v_0:jakarta.faces.partial.execute=j_id__v_0:form j_id__v_0:form:button
j_id__v_0:jakarta.faces.partial.render=j_id__v_0:form:button
{code}
(note the double viewstate is a minor issue I will fix monday, no time for that 
today anymore)

The prefix is only applied in the namingcontainer case.
Test look good, TCK 790 passes except for the naming container navigation.
You can use this base for the needed server side adjustments
(If you can leave diffs or prs here on that one, I can merge everything 
together, once I have adapted the old codebase as well)

TCK faces 22 passes except one test which never has passed so far (The ui 
repeat test)
So feel free to take over from here regarding the server side.


was (Author: werpu):
I just ran the test against mojarra here is the result

 
{code:json}
j_id1:form1=j_id1:form1
j_id1:jakarta.faces.ViewState=5807784481578067120:-3902354252644387665
j_id1:jakarta.faces.source=j_id1:form1:button
j_id1:jakarta.faces.partial.event=click
j_id1:jakarta.faces.partial.execute=j_id1:form1:button j_id1:form1
j_id1:jakarta.faces.partial.render=j_id1:panel2 j_id1:panel3
j_id1:jakarta.faces.behavior.event=action
j_id1:jakarta.faces.partial.ajax=true

{code}
 Ok they basically prefixed everything except for the non standard 
j_id1:form1=j_id1:form1 (which I had to take in to keep mojarra compatibility 
with my implementation)

So this means... in case of a naming container we really have to prefix 
everything, and also
the execute has the button in its cycle independent of being part of the 
executes list because it is the source!

The question remains as @volosied mentioned that at the encoding stage we do 
not have the naming container name present.
I think this is solvable simply by checkout our ViewState elements.
There is no other case where the ViewState element is prefixed, unless it is in 
a named naming container!

 ---
Hi I managed to pull of a preliminary working client script version in the link 
to my github branch 
(https://github.com/werpu/myfaces/tree/feature/MYFACES-4466-TCK790), which 
behaves the same as mojarra regarding the prefixes:
{code:json}
j_id__v_0:form_SUBMIT=1
j_id__v_0:jakarta.faces.ViewState=Zjc1YmUxYzI0ZjU2YzFiOTAwMDAwMDAx
j_id__v_0:jakarta.faces.ViewState=Zjc1YmUxYzI0ZjU2YzFiOTAwMDAwMDAx
j_id__v_0:jakarta.faces.behavior.event=action
j_id__v_0:jakarta.faces.partial.event=click
j_id__v_0:jakarta.faces.source=j_id__v_0:form:button
j_id__v_0:jakarta.faces.partial.ajax=true
j_id__v_0:form=j_id__v_0:form
j_id__v_0:jakarta.faces.partial.execute=j_id__v_0:form j_id__v_0:form:button
j_id__v_0:jakarta.faces.partial.render=j_id__v_0:form:button
{code}
(note the double viewstate is a minor issue I will fix monday, no time for that 
today anymore)

The prefix is only applied in the namingcontainer case.
Test look good, TCK 790 passes except for the naming container navigation.
You can use this base for the needed server side adjustments
(If you can leave diffs or prs here on that one, I can merge everything 
together, once I have adapted the old codebase as well)

TCK faces 22 passes except one test which never has passed so far (The ui 
repeat test)
So feel free to take over from here regarding the server side.

> TCK: Spec 790:  Viewstate input element's name attribute should be prefixed 
> with naming container id 
> -----------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-4533
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4533
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 4.0.0-RC2
>            Reporter: Volodymyr Siedlecki
>            Assignee: Werner Punz
>            Priority: Major
>         Attachments: image-2023-01-19-08-44-48-874.png, 
> image-2023-01-19-08-48-12-961.png, namespacedView.war
>
>
> Failing Line: 
> https://github.com/jakartaee/faces/blob/master/tck/faces23/namespacedView/src/test/java/ee/jakarta/tck/faces/test/javaee8/namespacedView/Spec790WithNamespacedViewIT.java#L15
>  5
> Generated Viewstate: 
> {code:java}
> <input type="hidden" name="jakarta.faces.ViewState" 
> id="j_id__v_0:jakarta.faces.ViewState:1" 
> value="NzVhMDlkOGYwNjY1ZWZkODAwMDAwMDAy" autocomplete="off">
> {code}
> The test expects the name attribute to be prefixed with `j_id__v_0`.  My 
> understanding is this should only apply when the view root is an instance of 
> a NamingContainer.   
> The test app's faces-config has the following configuration: 
> https://github.com/jakartaee/faces/blob/master/tck/faces23/namespacedView/src/main/webapp/WEB-INF/faces-config.xml#L25-L28



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

Reply via email to