[
https://issues.apache.org/jira/browse/MYFACES-4521?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17644549#comment-17644549
]
Werner Punz commented on MYFACES-4521:
--------------------------------------
Just double checked the js code looks correct to me:
{code:java}
myfaces.ab = function(source, event, eventName, execute, render, options) {
if (!options) {
options = {};
}
if (eventName) {
options["javax.faces.behavior.event"] = eventName;
}
if (execute) {
options["execute"] = execute;
}
if (render) {
options["render"] = render;
}
jsf.ajax.request(source, event, options);
}; {code}
The problem is the f:params must push the parameters in
{code:java}
options: {
params {
params1: "value1",
param2: "value2"
}
{code}
Just like the ri does, so a fix on the f:params side is unavoidable here to get
it right!
the problem is that our f:params pushes the parameters in the wrong way and
that clashes with f:ajax
{code:java}
<h:commandLink ...>
<f:ajax render="render1" execute="execute1" delay=500 onevent="eventfunc">
<f:param name="render" value="render2">
...
resolved atm into
myfaces.ab(...,...,"render1","execute1",/*options*/ {
"delay": 500,
"onevent":"eventfunc"
"render": "render2"
}
weheras the correct call as per spec should be
myfaces.ab(...,...,"render1","execute1",/*options*/ {
"delay": 500,
"onevent":"eventfunc"
params: {
"render": "render2"
}
}
Now if we pass the parameters down this way, a clash between f:param and f:ajax
is not possible anymore!
{code}
> faces.js handing of params attribute missing in the old jsf.js codebase
> -----------------------------------------------------------------------
>
> Key: MYFACES-4521
> URL: https://issues.apache.org/jira/browse/MYFACES-4521
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 2.2.15, 2.3-next-M7, 4.0.0-RC2
> Reporter: Werner Punz
> Assignee: Werner Punz
> Priority: Major
> Fix For: 2.3-next-M8, 4.0.0-RC3
>
>
> In reference to https://issues.apache.org/jira/browse/MYFACES-4040
> We have had a spec deviation from the spec since jsf 2.0
> apparently request parameters must be passed in the options associative array
> under the key params (see link above where I documented it)
> This already has been fixed in the new typescript codebase but the fix is
> missing from the old javascript codebase.
> The fix is fairly straight forward.
> For now we will keep the old behavior, to keep legacy code intact, but the
> f:params renderer also must be adapted accordingly.
> Either I will do that or someone else.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)