jsf 2 - JSF: Datatable is not updating -
i learning jsf , stuck on below problem:
xhtml class:
<h:form><p:inputtext value="#{tempview.tempname}" e:placeholder="search name"> </p:inputtext> <p:commandbutton id="search" value="search" action="#{tempview.searchname()}" update="datatable"> </p:commandbutton> <p:commandbutton value="clear" action="#{tempview.clearsearchcriteria()}" update="datatable"> </p:commandbutton> <p:datatable id="datatable" value="#{tempview.tmplist}" var="tempvar" rowstyleclass="#{tempview.rowstyleclass(tempvar)}" rows="12" paginator="true" paginatortemplate="{currentpagereport} {firstpagelink} {previouspagelink} {pagelinks} {nextpagelink} {lastpagelink} {rowsperpagedropdown}" rowsperpagetemplate="5,10,15" scrollable="true"> <p:column headertext="first name" sortby="#{tempvar.firstname}"> <h:outputtext value="#{tempvar.firstname}" /> </p:column> <p:column headertext="last name" sortby="#{tempvar.lastname}"> <h:outputtext value="#{tempvar.lastname}" /> </p:column> <p:column headertext="institute / practice name" sortby="#{tempvar.address}"> <h:outputtext value="#{tempvar.institutename}" /> </p:column> </p:datatable>
java class:
public string searchname() { system.out.println("executed"); /** logic of refining list.. **/
}
the issue facing is..first calling getter , setter method , action 'searchname' , after executing action method. not calling getter , setter due datatable not updating. action method 'searchname' have logic of refining list in datatable. please let me know if need other information. thanks.
instead of using action , use actionlistener
. need change method in bean return void , add actionevent
paramter.
Comments
Post a Comment