2

After a Primefaces upgrade from 6.0 to 8.0 - and a WildFly upgrade to use JakartaEE - my ajax event listener isn't called anymore. However the onsuccess and oncomplete JS is executed.

My XHTML:

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://xmlns.jcp.org/jsf/html"
  xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
  xmlns:cc="http://xmlns.jcp.org/jsf/composite"
  xmlns:p="http://primefaces.org/ui"
  xmlns:f="http://xmlns.jcp.org/jsf/core"
  xmlns:pe="http://primefaces.org/ui/extensions">
<h:body>
    <ui:composition template="/WEB-INF/template.xhtml">
        <ui:define name="container">
            <p:graphicImage id="myImage" library="projectLib" name="logo.png"/>
            <pe:imageAreaSelect id="areaSelect" for="myImage" handles="true">
                <p:ajax event="selectEnd" listener="#{testBean.selectEndListener}" oncomplete="console.log('complete')" onsuccess="console.log('success')"/>
            </pe:imageAreaSelect>
        </ui:define>
    </ui:composition>
</h:body>
</html>

My bean:

@Named
@ViewScoped
public class TestBean implements Serializable {

    public void selectEndListener(final ImageAreaSelectEvent e) {
        // do something
    }

}

Nothing unusual to see in the server logs. In my browser console, I see the following warning:

[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/

Can anyone tell me what is going wrong?

  • Primefaces: 8.0
  • Primefaces extensions: 8.0.4
  • JSF: jboss-jsf-api_2.3_spec
  • WildFly: 21.0.2.Final
13
  • Let me investigate it might be a bug.
    – Melloware
    Commented Jan 20, 2021 at 14:24
  • Update: it looks like the listener attribute is completely ignored. If I fill in a non existing method in the listener EL, no exception is thrown and the page renders as usual. Even when I fill in some random chars in EL no exception is thrown, as long as it is between #{}
    – j.a
    Commented Jan 20, 2021 at 14:59
  • What version of Wilfly because I tested locally with Jetty and its all working. I know there are issues I have seen with latest Wildfly 21 so I would back up to WildFly 18
    – Melloware
    Commented Jan 20, 2021 at 15:02
  • Until PrimeFaces and PFE release "jakarta" versions of their JARS in 10.0.0 you won't be able to use EE9 spec which changes everything from javax package to jakarta package.
    – Melloware
    Commented Jan 20, 2021 at 15:04
  • 1
    My reproducer was missing a form indeed. But in the context of my project, I still cannot get it working. The graphicImage and imageAreaSelect are within an outputPanel that's within a h:form
    – j.a
    Commented Feb 1, 2021 at 13:27

1 Answer 1

0

I have the same problem, but it was after I configure the Wildfly session-cookie to http-only=true and secure=true, undoing this, mi application works again.

PF 7.0.17 Wildfly 20

Not the answer you're looking for? Browse other questions tagged or ask your own question.