This is my code :-
<p:carousel var="item" animate="true" circular="true" rows="2" effect="easeOutStrong" value="#{RegisterBean.objBlogTemplateList}">
<h:inputHidden id="hdnBlogTemplateId" binding="#{RegisterBean.hdnBlogTemplateId}" value="#{item.templateId}"/>
<h:graphicImage alt="#{item.templatePicName}" style="border: solid 5px white;width: 200px;height: 200px;" value="#{app:getCommonImagePath(item.templatePicName)}">
<f:ajax event="click" execute="hdnBlogTemplateId" listener="#{RegisterBean.setBlogTheme}"/>
</h:graphicImage>
</p:carousel>
This is my managed bean code :-
private HtmlInputHidden hdnBlogTemplateId;
public HtmlInputHidden getHdnBlogTemplateId() {
return hdnBlogTemplateId;
}
public void setHdnBlogTemplateId(HtmlInputHidden hdnBlogTemplateId) {
this.hdnBlogTemplateId = hdnBlogTemplateId;
}
public void setBlogTheme(AjaxBehaviorEvent e){
System.out.println("Hello");
//System.out.println(hdnBlogTemplateId.getValue());
//System.out.println(objGraphic.toString());
}
Hello is never printed in my console. Please help.