Update single row in JSF / Primefaces datatable using AJAX -


how update single row in p:datatable when using ajax?

i don't want update whole datatable because has lot of rows , it's going take time..

my layout:

<h:form id="visitform">         <p:datatable id="visittable" var="visit" value="#{visitbean.findallvisits()}">              <p:column headertext="${msgs['email']}"                 <h:outputtext value="#{visit.contactdetail.email}"/>             </p:column>              <p:column headertext="${msgs['clearance']}" id="clearance">                 <p:commandbutton value="${msgs['clearance.ok']}"  actionlistener="#{visitbean.makeclearancenotok(visit)}"/>             </p:column>         </p:datatable>     </h:form> 

i've tried out things update = "clearance" etc doesn't seem work.

i'm using jsf 2.1 , primefaces 5.2

you can use @row(n) search expression - updates nth row in table. in order update current row, need pass row index argument. set rowindexvar="rowidx" attribute on <p:datatable> , then:

<p:commandbutton ... update="@form:visittable:@row(#{rowidx})" /> 

Comments