ajax - Update just on Tab of acordion Primefaces -
i have accordion dynamic number of tabs. tab title set css class. makes background ether green or red, depends on if articles in order delivered.
for every article there selectbooleanbutton , on every change of these buttons actual tab should updated.
the problem is: how can update 1 tab? when update whole accordion first tab opens , other closed.
<p:accordionpanel id="ordersaccordion" cache="true" value="#{ordersbean.orders}" var="order"> <p:tab titlestyleclass="#{ordersbean.isorderdelivered(order) ? 'ui-accordion-tab-delivered' : 'ui-accordion-tab-undelivered'}" title="##{order.order_id} | #{order.printableorderdate} | #{order.printableordertime} | #{order.user} | #{order.getdestination().tostring()}"> <p:datatable value="#{order.demands}" var="demand"> <p:column headertext="artikel nr."> <p:outputlabel value="#{demand.article.articlenumber}" /> </p:column> <p:column headertext="name"> <p:outputlabel value="#{demand.article.name}" /> </p:column> <p:column headertext="beschreibung"> <p:outputlabel value="#{demand.article.description}" /> </p:column> <p:column headertext="haus"> <p:outputlabel value="#{demand.house.getlabel()}" /> </p:column> <p:column headertext="anzahl"> <p:outputlabel value="#{demand.quantity}" /> </p:column> <p:column headertext="mitarbeiter"> <p:outputlabel value="#{demand.employee}" /> </p:column> <p:column headertext="lieferstand" width="150" style="text-align: center"> <p:selectbooleanbutton id="deliverdbtn" value="#{demand.delivered}" onlabel="geliefert" offlabel="geliefert" onicon="ui-icon-check" officon="ui-icon-close"> <p:ajax listener="#{ordersbean.savedelivered(demand)}" update=":allorders:ordersaccordion" /> </p:selectbooleanbutton> </p:column> </p:datatable> </p:tab> </p:accordionpanel>
thanks help
the accordionpanel has activeindex attribute can use work on current tab. should able this:
<p:ajax listener="#{ordersbean.savedelivered(demand)}" update=":allorder:ordersaccordion:tab#{ordersaccordion.activeindex}" />
Comments
Post a Comment