[ https://issues.apache.org/jira/browse/MYFACES-4588?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17697589#comment-17697589 ]
Melloware edited comment on MYFACES-4588 at 3/7/23 8:51 PM: ------------------------------------------------------------ Yeah that is saying ONLY use `document.body` if `node` is NULL or undefined. I think it needs to be two separate searches not an either or. Something like (just psuedocode)... {code:java} let nodeRoot = new DQ(node).querySelectorAll(`form input [name='${P_CLIENT_WINDOW}']`); let docRoot = new DQ(document.body).querySelectorAll(`form input [name='${P_CLIENT_WINDOW}']`); {code} {code:java} // combine both collections into the full result set let searchRoot = nodeRoot.addAll(docRoot);{code} was (Author: melloware): Yeah that is saying ONLY use `document.body` if `node` is NULL or undefined. I think it needs to be two separate searches not an either or. > faces.getClientWindow does not retrieve 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 > Fix For: 4.0.1 > > > 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)