I have two p:ajax tags registered for the same rowSelect event on a datatable.
One p:ajax resides inside a composite component to only update common regions in the page, the other p:ajax has a listener and it is registered outside the composite component.
I observed the listener from the outside p:ajax to be called twice. How can the listener method be executed one time only, as it is registered only on one p:ajax tag?
<myComp:dataTable ...>
<p:ajax event="rowSelect" update=":form:tableDetails" listener="#{backingBean.selectRow}"/>
</myComp:dataTable>
and here the CC code:
<cc:interface >
<cc:clientBehavior event="rowSelect" name="rowSelect" targets="#{cc.clientId}:dataTable" />
</cc:interface>
<cc:implementation>
<p:dataTable id="dataTable" ...>
<p:ajax event="rowSelect" update=":form:footPanelAndButtons"/>
</p:dataTable>
</cc:implementation>
I omitted the most of the attributes on the tags to keep it simple.
I know this is might be a performance issue since client/server communication occurs twice for the same event.