jsf - Ajax call inside dataTable not working -
i trying make ajax call inside jsf datatable on checkobx value change. corresponding backing bean not getting fired.
when tried same thing outside datatable, ajax call getting invoked , sop's getting printed.
following code
<!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" > <h:body> <h:head></h:head> <section class="box"> <h:form> <f:event type="prerenderview" listener="#{adminaccounts.getappinfonew()}" /> <div class="row-fluid"> <div class="span7" style=""> <span class="heading">manage accounts</span> </div> </div> <!-- outside datatable ajax call working --> <h:selectbooleancheckbox checked="checked" value="#{adminaccounts.testvalue}"> <f:ajax listener="#{adminaccounts.changingtabvisiblity}"></f:ajax> </h:selectbooleancheckbox> <h:datatable id="diagnosis_list_2" value="#{adminaccounts.appslist}" var="apps"> <h:column> <f:facet name="header">position</f:facet> #{apps.appname} </h:column> <h:column> <f:facet name="header">campaign management</f:facet> <!-- inside datatable ajax call not working --> <h:selectbooleancheckbox checked="checked" value="#{adminaccounts.testvalue}"> <f:ajax listener="#{adminaccounts.changingtabvisiblity}"></f:ajax> </h:selectbooleancheckbox> </h:column> </h:datatable> </h:form> </section> </h:body> </html>
also following bean class
@managedbean(name = "adminaccounts") @requestscoped public class adminaccounts { private list<appdummylist> appslist = new arraylist<appdummylist>(); public boolean testvalue; public boolean testvalue1; public boolean istestvalue1() { return testvalue1; } public void settestvalue1(boolean testvalue1) { this.testvalue1 = testvalue1; } public boolean istestvalue() { return testvalue; } public void settestvalue(boolean testvalue) { this.testvalue = testvalue; } public list<appdummylist> getappslist() { return appslist; } public void setappslist(list<appdummylist> appslist) { this.appslist = appslist; } public void getappinfonew() { system.out.println("get info called"); appslist.add(new appdummylist("amazon")); appslist.add(new appdummylist("bookmyshow")); appslist.add(new appdummylist("flipkart")); appslist.add(new appdummylist("foodpanda")); } public void changingtabvisiblity() { system.out.println("value=" + testvalue); system.out.println("value1=" + testvalue1); } }
need on why ajax call not working inside datatable.
Comments
Post a Comment