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

Werner Punz commented on MYFACES-4521:
--------------------------------------

Hi I have not fixed the myfaces ab yet, probably closed this too early, I 
assumed the parameters are passed down properly anyway if you pass them down as 
params.

 

The proposed fix is not correct, 

options should be passed in as is, but with execute and render being passed 
into the options as well

aka 

```javascript

myfaces.ab = function(source, event, eventName, execute, render, options) {

}

 

very likely should result in 

myfaces.ab(source, event, "excute1 excute2", "render1 render2", {

delay: 500,

onError:myFunc;

params: {

  param1: "value1",

 param2: "value2"

}

}

 

```

should result in following request

 

```javascript

jsf.ajax.request(source, event, {

    delay: 500,

   onError: myFunc,

  execute:  "excute1 excute2",

  render: "render1 render2", 

 params: {

   param1: "value1",

  param2: "value2"

 }

}

 

```

after the request then is performed following is sent down:

 

xhrData:

```javascript

param1: "value1"

param2: "value2"

jakarta.faces.source: < id of source>

jakarta.faces.partial.ajax: true

jakarta.faces.ViewState: <viewstate>

{{jakarta.faces.partial.render: "render1 render2",}}

{{{}{}}}{{{}jakarta.faces.partial.execute: "excute1 excute2",{}}}

{{..(and some implementation specifics)}}

{{```}}

{{You get the idea.... my fix atm was only on the js side of things where the 
parameters}}

{{were not taken into consideration (}}

{{So if this does not resolve that way, we have to fix, it please raise another 
issue, I will take care of it, monday, unless you guys want to fix it.}}

{{}}

{{{}{}}}{{{}{}}}

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

Reply via email to