0
votes

I have a primeface datatable as follows

<p:dataTable id="associatedProductsTable" var="oap" 
 value="#{checkoutController.associatedProducts}"
 styleClass="cssAssociatedProductsTable">
    <p:column>#{oap.product.code}</p:column>
    <p:column>
        <p:selectBooleanCheckbox value="#{oap.includedInOrder}" />
    </p:column>
<p:column>#{oap.productPriceTotal}</p:column>
</p:dataTable>

the productPriceTotal field is 0 as long as selectBooleanCheckbox is unchecked. My desire is to set the value of productPriceTotal when user selects the checkbox value of selectBooleanCheckbox I do not care if this is happening with a postback or dynamically ajax, but no matter how I am doing it I canot get it working.

Thanks

1
What have you tried? The question basically comes down to: "I want something, can someone else do it?" Hint: you should update the full table. - siebz0r

1 Answers

0
votes

I have done it. Actually I was looking for an example, for some documentation to make it easier for me. It works now very nice. The problem was that the update of the table was supposed to be done only once at page load, and I was not doing this. I was loading the data each time on each refresh, so of course, no matter what i was changing, the data was wiped out, by the reload.

if (!FacesContext.getCurrentInstance().isPostback()) 
{
     //load once 
}

It works now

Thanks