So after digging through the docs it is a little bit clearer, I missed a
second section in the JSDocs, however they need some overhaul:

Here are the sections affecting everything:
 https://jakarta.ee/specifications/faces/4.0/jsdoc/faces.ajax.html

 If the ID of the jakarta.faces.ViewState element has a
<VIEW_ROOT_CONTAINER_CLIENT_ID><SEP> prefix, where <SEP> is the currently
configured UINamingContainer.getSeparatorChar() and
<VIEW_ROOT_CONTAINER_CLIENT_ID> is the return from
UIViewRoot.getContainerClientId() on the view from whence this state
originated, then remember it as namespace prefix. This is needed during
encoding of the set of post data arguments.


* Encode the set of post data arguments. If the jakarta.faces.ViewState
element has a namespace prefix, then make sure that all post data arguments
are prefixed with this namespace prefix.*


While the rest of the documentation talks about sending the raw
jakarta.faces.ViewState

I think it makes sense to prefix it if present always, which means also
adding it to the name, just like mojarra does!
I will to start to work on this, except a pull request tomorrow.



Am Mi., 18. Jan. 2023 um 07:27 Uhr schrieb Werner Punz <
[email protected]>:

> Yes atm only the id is updated in the js not the name. However in the new
> codebase (I have to check the old whether I did the same) it is taken into
> consideration that the name also can be prefixed!
> Prefixing the name is a 2 liner, but I kept it deliberately out just not
> to break anything until the server side implements it.
> It basically just is that you have to replicate the id more or less into
> the name (not sure if the counter at the end of the id in a multi form
> scenario is replicated as well, as I wrote before, the specs are very
> unclear on the name handling regarding prefix and postfixes, but only want
> for instance jakarta.faces.ViewState in the request as parameter, hence my
> idea to challenge the name prefixing altogether for clearance.
>
> I will todayl try to gather all the information we have on this topic and
> then either write a challenge or fix it on our side.
>
>
>
>
> Am Di., 17. Jan. 2023 um 21:14 Uhr schrieb Volodymyr Siedlecki (Jira) <
> [email protected]>:
>
>>
>>     [
>> https://issues.apache.org/jira/browse/MYFACES-4533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17677963#comment-17677963
>> ]
>>
>> Volodymyr Siedlecki commented on MYFACES-4533:
>> ----------------------------------------------
>>
>> Yes, I tried to prefix the name with the container id here: [
>> https://github.com/apache/myfaces/pull/435/files#diff-caf34c8854dfe9d2b267509188e349cde623bd63db49a279f224c99511297e58R127-R139
>> ]
>>
>> However, I don't see MyFaces updating the name attribute in the prefix
>> via JavaScript after an ajax response.
>>
>> > 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: 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