I have an outputtext showing the number of services on the screen:
<h:outputText
value="Services #{bean.counterManager.serviceCounter}">
</h:outputText>
and below it an accordionpanel that calls the getServices() method:
<p:accordionPanel value="#{bean.services}" var="service">
In the getServices()
method I increment the counter and when I debugged at the return point it was 143.
public List<Service> getServices()
{
if (this.services.isEmpty())
{
//Does other stuff, fills this.Services
this.counterManager.incrementServiceCounter(someValue); //
}
return this.services;
}
But it appears 0 on screen, because getServices()
is called after outputText calls getCounterManager()
probably because the outputtext is above the accordionpanel on my XHTML.
I'd like for serviceCounter to show 143 and not 0, but I don't how to make it render after getLinhasStruct() is called, I can't put it the outputtext below accordion panel because that would mess with the layout of the page so how can I do that?