简体   繁体   中英

Primefaces ajax listener not invoked after upgrade

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM