I havent worked out how to call/invoke a method dynamically without using the @PostContruct method and initialising @ the page creation.
At the moment I am simply trying to get the primeface p:poll example working. I have placed the method in its own class for now to keep it clean and simple & looks like so:
@ManagedBean(name="counterBean")
@SessionScoped
public class CounterBean implements Serializable {
private int count;
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public void increment(ActionEvent actionEvent) {
setCount(getCount() + 1);
}
}
And then the xhtml code:
<h:form>
<h:outputText id="txt_count" value="#{counterBean.count} " />
<p:poll interval="3" listener="#{counterBean.increment}" update="txt_count"/>
</h:form>
Intellisense within netbeans tells me that the "increment" part of #{counterBean.increment} is an "Unknown Property" i.e. it cant find the method. So how can I get JSF to recognise and invoke this method from the xhtml?