Hello all,
I've put aside this problem for a moment, now I am back on it.
after a bit of investigation, I made this observation:
I have this output panel in a main.xhtml page (welcom page), which calls another xhtml page:
Code: Select all
<p:outputPanel id="bottomPanel">
<p:panel rendered="#{searchPeopleController.searchTabSelected}">
<ui:include src="/searchResultsList.xhtml" />
</p:panel>
<p:panel rendered="#{!searchPeopleController.searchTabSelected}">
<ui:include src="/RDUdetails.xhtml" />
</p:panel>
</p:outputPanel>
Here is the searchResultsList.xhtml:
Code: Select all
<h:form>
<p:dataTable var="result" value="#{searchPeopleController.searchResults}"
selection="#{searchPeopleController.selectedCitizen}" paginator="true" selectionMode="single">
<f:facet name="header">
Résultats de la recherche
</f:facet>
<p:column>
<f:facet name="header">
NOM
</f:facet>
<h:outputText value="#{result.firstName}" />
</p:column>
<p:column>
<f:facet name="header">
PRÉNOM
</f:facet>
<h:outputText value="#{result.lastName}" />
</p:column>
<p:column>
<f:facet name="header">
DATE DE NAISSANCE
</f:facet>
</p:column>
...
...
<p:column style="width:32px">
<p:commandButton ajax="true" value="détails" action="#{searchPeopleController.onSelection}" update="topTab" >
<f:setPropertyActionListener value="#{result}" target="#{searchPeopleController.selectedCitizen}" />
</p:commandButton>
</p:column>
</p:dataTable>
</h:form>
The observation is:
when my output panel (welcome page) is loaded, the method:
Code: Select all
public List<Personne> getSearchResults() {
return searchResults;
}
is called twice! And when this panel has to be updated, it is every time called twice.
Why!?
Another observation, is that when I click on the "Details" button, (see above the last tag in my form), the above method (getSearchResults()) is called many times, more than 10 times!
And the original problem is still unsolved: when I click on a row in my table, the onSelection method is not even called.
I would be grateful for any hint or help. Thanks.