I have a <p:dataTable> in a facelet. The facelet is included into a page. A selection of a table row should trigger an update on an element of the surrounding page.
When I include the <p:ajax event="rowSelect" update=":open:separate" /> inside the table, all works fine. But I am using the table on multiple pages and cannot guarantee a constant Id for the updated element.
I have tried removing the <p:ajax> from the table and wrap the included table inside it like this:
<p:ajax event="rowSelect" update=":open:separate">
<ui:include src="/open/components/submittersTable.xhtml"/>
</p:ajax>
I get this error (root cause abridged):
javax.servlet.ServletException: /open/index.xhtml @30,59 <p:ajax> Event:rowSelect is not supported.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
root cause
javax.faces.view.facelets.TagException: /open/index.xhtml @30,59 <p:ajax> Event:rowSelect is not supported.
org.primefaces.component.behavior.ajax.AjaxBehaviorHandler.applyAttachedObject(AjaxBehaviorHandler.java:148)
org.primefaces.component.behavior.ajax.AjaxBehaviorHandler.apply(AjaxBehaviorHandler.java:126)
Am I having wrong ideas about what is possible with <p:ajax>? Do I have to include it into the table and try forcing the ids on the surrounding pages to fit? Or is it possible to wrap include with ajax and I’m just doing it wrong?
Thank you
No you can’t because of event=”rowSelect”. Some explanation of event=”rowSelect” mean ‘a row in the datatable is selected’. So you cannot use this outside of p:dataTable.