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

Werner Punz edited comment on MYFACES-4588 at 3/8/23 2:13 PM:
--------------------------------------------------------------

I will take care of it!

And yes clearly a bug in the new code the fix very likely is what is proposed. 
I will add a testcase for this usecase, obviously I have missed this.

--

3 smaller issues besides missing tests

a) it indeed did not do a proper fallback in the proper order

b) it did not check for a match on the same level as well

c) the code does not check for url as fallback (this is not per se in the spec, 
but the old code did), instead it is checking the faces.js includes for a 
cliend id parameter

The fixes now fix all three things, since c) is out of spec, I fullfill the 
spec first, if it fails it will check the url, and if that does not work it 
searches also the jsf.js

 

We can remove c) entirely if you guys are sure that that no one is using the 
"fallbacks" would make the code a little bit leaner

 


was (Author: werpu):
I will take care of it!

And yes clearly a bug in the new code the fix very likely is what is proposed. 
I will add a testcase for this usecase, obviously I have missed this.

 

> 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)

Reply via email to