once again the combination of PrimeFaces and GAE drives me crazy. Inside a p:dataTable
I want to click a image, call a bean method and set a parameter. The method is called, but the parameter does not work. Here is a simplified example (without the table):
<h:form id="f1">
<h:outputText id="text" value="#{testBean.index}"/>
<h:graphicImage url="/images/cut.png">
<p:ajax event="click" process="@this" update="text"
actionListener="#{testBean.test}" >
<f:setPropertyActionListener target="#{testBean.index}" value="5" />
</p:ajax>
</h:graphicImage>
</h:form>
My TestBean
looks like this:
@javax.faces.bean.ManagedBean @ViewScoped
public class TestBean implements Serializable{
private int index; // getter/setter
@PostConstruct public void init() {
index = 0;log.log(Level.WARNING, "@PostConstruct");}
public void test(ActionEvent ae){
log.log(Level.WARNING, "Index: "+index);}
}
In the Logs I see one @PostConstruct
and after clicking the image always Index: 0
Update The value update problem may be discussed here JSF GAE: Value Update Problem in managed bean method
`.