[
https://issues.apache.org/jira/browse/MYFACES-4588?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17697517#comment-17697517
]
Volodymyr Siedlecki commented on MYFACES-4588:
----------------------------------------------
Spec Doc: [https://jakarta.ee/specifications/faces/4.0/jsdoc/faces.html]
h4. (static) getClientWindow(node)
Return the windowId of the window in which the argument form is rendered.
h5. Parameters:
||Name||Type||Description||
|{{node}}|DomNode|Determine the nature of the argument. If not present, search
for the windowId within {{{}document.forms{}}}. If present and the value is a
string, assume the string is a DOM id and get the element with that id and
start the search from there. If present and the value is a DOM element, start
the search from there.|
> 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
> 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)