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

Werner Punz edited comment on MYFACES-4521 at 12/7/22 11:22 PM:
----------------------------------------------------------------

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 
{code:java}
myfaces.ab = function(source, event, eventName, execute, render, options) {
....
}
{code}
 

very likely should result in 
{code:java}
myfaces.ab(source, event "click", "excute1 excute2", "render1 render2", {
  delay: 500,
  onError:myFunc;
  params: {  
     param1: "value1",  
     param2: "value2"
  }
}
{code}
should result in following request

 
{code:java}
jsf.ajax.request(source, event, {
   delay: 500,
   onError: myFunc,
   
   execute:  "excute1 excute2",
   render: "render1 render2", 
   params: { param1: "value1", param2: "value2" }

})

{code}
after the request then is performed following is sent down:
{code:java}
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",
...{code}
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.

The other thing is, the f:ajax renderer must be altered so that params are 
passed under the params key in the options!


was (Author: werpu):
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 

{code:java}
myfaces.ab = function(source, event, eventName, execute, render, options) {
....
}
{code}


 

very likely should result in 


{code:java}
myfaces.ab(source, event, "excute1 excute2", "render1 render2", {
  delay: 500,
  onError:myFunc;
  params: {  
     param1: "value1",  
     param2: "value2"
  }
}
{code}




should result in following request

 

{code:java}

jsf.ajax.request(source, event, {
   delay: 500,
   onError: myFunc,
   execute:  "excute1 excute2",
   render: "render1 render2", 
   params: {    param1: "value1",   param2: "value2"  }

})

{code}


after the request then is performed following is sent down:


{code:java}
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",
{code}



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.

The other thing is, the f:ajax renderer must be altered so that params are 
passed under the params key in the options!


> 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