You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Volodymyr Siedlecki (Jira)" <de...@myfaces.apache.org> on 2023/03/07 16:23:00 UTC

[jira] [Comment Edited] (MYFACES-4588) jsf.getClientWindow does not retreive client id

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

Volodymyr Siedlecki edited comment on MYFACES-4588 at 3/7/23 4:22 PM:
----------------------------------------------------------------------

I think something wrong is occurring with
|let searchRoot = new DQ(node \|\| document.body).querySelectorAll(`form input [name='${P_CLIENT_WINDOW}']`);|

[~werpu]  Could you take a look?

We should search the node first and then the document forms, I think?  Not sure what the current logic is with DQ(node || document.body)?


was (Author: volosied):
I think something wrong is occurring with 
|let searchRoot = new DQ(node \|\| document.body).querySelectorAll(`form input [name='${P_CLIENT_WINDOW}']`);|


[~werpu]  Could you take a look?

> jsf.getClientWindow does not retreive client id
> -----------------------------------------------
>
>                 Key: MYFACES-4588
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4588
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 4.0.0
>            Reporter: Volodymyr Siedlecki
>            Assignee: Werner Punz
>            Priority: Major
>
> Code
> web.xml:
> {color:#d4d4d4} {color}
> {code:java}
> <context-param>
> <param-name>jakarta.faces.CLIENT_WINDOW_MODE</param-name>
> <param-value>url</param-value>
> </context-param>{code}
> {color:#808080}
> {color}
> facelet' script:
> {color:#d4d4d4} {color}
> {code:java}
> var clientWindowId = faces.getClientWindow(document.forms[0]);{code}
> When *faces.{color:#dcdcaa}getClientWindow{color}* is called, it returns null when it should return the client id instead.
> The older JS looks to retrieve the id from the this element (client is not part of the URL on the first request):
> {code:java}
> <input type="hidden" id="j_id__v_0:jakarta.faces.ClientWindow:1" name="jakarta.faces.ClientWindow" value="-tw96zi9et">{code}
> 3.0 JS:
> [https://github.com/apache/myfaces/blob/3.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Impl.js#L862-L881]
> 4.0 JS:
> [https://github.com/apache/myfaces/blob/15baed38ba3425c9e8b988906ab5958bf491ec86/api/src/client/typescript/faces/impl/AjaxImpl.ts#L470-L515]



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