[
https://issues.apache.org/jira/browse/MYFACES-4737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18056737#comment-18056737
]
Werner Punz edited comment on MYFACES-4737 at 2/5/26 6:20 PM:
--------------------------------------------------------------
I have a working prototype on then 4.0.4 branch, see image! However i see two
problems. I only can add this behavior to the name attribute. We however have
two ways to determine the variable name, either the name attribute or if that
one is not set the client identifier. The client identifier is out of scope
given it can be auto generated and can have a . as valid part of a name!
Not sure if we should add it for the name attribute only, and if yes, which
versions do we add it to? (4.x + only or are we going to backport it?) anyway
here would be the resullt you can expect! As you can see I had to add a new
helper function to the myfaces namespace on the javascript side, and on the
java side a small cdoe adaption in the Javascript Helpers and the Command
Script renderer was needed to pull it off. So lets leave this open for
discussion now where we should go forward with this!
PS: The current behavior is that the namespace is mapped into the variable name
with a substitute for "." If we now introduce this behavior, we might break
existing code, so I am 50/50 on this whether we can introduce this without
consulting the spec people!
!image-2026-02-05-19-16-11-500.png|width=754,height=249!
was (Author: werpu):
I have a working prototype on then 4.0.4 branch, see image! However i see two
problems. I only can add this behavior to the name attribute. We however have
two ways to determine the variable name, either the name attribute or if that
one is not set the client identifier. The client identifier is out of scope
given it can be auto generated and can have a . as valid part of a name!
Not sure if we should add it for the name attribute only, and if yes, which
versions do we add it to? (4.x + only or are we going to backport it?) anyway
here would be the resullt you can expect! As you can see I had to add a new
helper function to the myfaces namespace on the javascript side, and on the
java side a small cdoe adaption in the Javascript Helpers and the Command
Script renderer was needed to pull it off. So lets leave this open for
discussion now where we should go forward with this!
PS the current behavior is that the namespace is mapped into the variable name
with a subistite for "." if we now introduce this behavior we might break
existing code, so I am 50/50 on this whether we can introduce this without
going to the spec people!
!image-2026-02-05-19-16-11-500.png|width=754,height=249!
> h:commandScript can't make a function in a namespace.
> -----------------------------------------------------
>
> Key: MYFACES-4737
> URL: https://issues.apache.org/jira/browse/MYFACES-4737
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 4.0.3
> Environment: macOS Tahoe 26.1, Apache Tomee web 10.1.2, Apache
> NetBeans 28, Temurin JDK build 21.0.8+9-LTS
> Reporter: Johan Borchers
> Assignee: Werner Punz
> Priority: Minor
> Attachments: image-2025-12-17-13-39-25-303.png,
> image-2025-12-17-13-42-23-466.png, image-2025-12-17-13-46-31-788.png,
> image-2025-12-29-13-07-53-716.png, image-2026-02-05-08-32-26-857.png,
> image-2026-02-05-08-33-09-531.png, image-2026-02-05-19-16-11-500.png
>
>
> The h:commandScript can't make a function in a namespace.
> When I want my functions to go into a predefined JS namespace (object) then
> it places the function in the global JS namespace with a name of the
> [namespace][escape sequence for the dot][name of the function]
> With Mojarra this is working.
> !image-2025-12-17-13-39-25-303.png|width=586,height=586!
> The functions go into the global namespace with MyFaces.
> !image-2025-12-17-13-42-23-466.png|width=356,height=164!
>
> With Mojarra the functions go into the namespace.
> !image-2025-12-17-13-46-31-788.png|width=305,height=143!
> I hope that MyFaces will also support the placing in namespaces.
> Because we are using Open Liberty server side.
> The example with the namespace is from the book :
> The Definitive Guide to Jakarta Faces in Jakarta EE 10
> Bauke Scholtz
> Arjan Tijms
--
This message was sent by Atlassian Jira
(v8.20.10#820010)