1

We migrated our JSF 2.2 based application to JSF 2.3, Except of some smaller issues we were able to get everything up and running. For one view we use Butterfaces JSF component, especially the tree component. With JSF 2.3 it was not possible to select a node and to show details of that node in another container. The apprropriate Ajax request sends the id of the node as options.params. That worked fine with JSF 2.2 but is not working anymore with JSF 2.3. We are still on Butterfaces 2 ( which should work due to downward compatibility), but even in the showcase of Butterfaces 3 on Java EE 8, the select via Ajax seems not to work.

I had a look on the jsf.ajax.request Javascript method of JSF 2.3, debugged it and realized, that the param was ignored and deleted since it seems to be the wrong format. Thus, I monkey patched the method in our application with this little stupid code snippet, to get the param sent to the server via the ajax request:

var originalJsfAjaxRequest = jsf.ajax.request;
jsf.ajax.request = function (source, event, options) {
    options.params = {params: options.params};
    originalJsfAjaxRequest.apply(this, [source, event, options]);
}

That's it, it is working fine again.

So my question is, where the problem is supposed to be. Is it a problem in JSF to ignore these sort of params. Or is it a problem of Butterfaces using the parameters in a wrong way? What is the correct way, to use options.params?

Thanks in advance

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
jheider
  • 111
  • 8

1 Answers1

-1

I don't know why, but JSF 2.3 ignores param attribute when using jsf.ajax.request. There is an ButterFaces issue: https://github.com/ButterFaces/ButterFaces/issues/232 and a new release will be released this or next week.

Lars Michaelis
  • 559
  • 2
  • 6
  • 11
  • 1
    You also filed an issue with Mojarra (assuming that is what is tried/used)? (JSF 2.3 is by iteslf just an api) – Kukeltje Sep 23 '19 at 18:03
  • ButterFaces is working against JSF API. It should be work with Mojarra and MyFaces as well. – Lars Michaelis Sep 24 '19 at 12:21
  • ButterFaces 3.1.2 has been released! – Lars Michaelis Sep 24 '19 at 12:22
  • 1
    **_But if it is some regression in Mojarra, they should fix it and they can only fix it if they know_** Now you maybe have introduced specific code for Mojarra or implemented some workaround that should just normally work... – Kukeltje Sep 24 '19 at 12:33
  • Yes, you are not wrong. ButterFaces now use fallback if the specified path does not work. If it is a bug in Mojarra which is fixed, it will continue to work as intended. – Lars Michaelis Sep 27 '19 at 08:38
  • What you fail to get from my comments is that **bugs (if it is a bug) don't get fixed by magic but by people reading bug reports and fixing them and if a bug report is not filed with Mojarra...** So PLEASE file a bug report and add the link to it in the answer above. – Kukeltje Sep 27 '19 at 08:46