0
votes

PF 3.5.10, Mojarra 2.1.21, JBoss 7.1.1, PE 7.1, Omnifaces 1.5

I want to use datatable row editing in a p:Dialog. I have a datatable with a row editing in a Dialog. (Showcase: http://www.primefaces.org/showcase/ui/datatableRowEditing.jsf) If I click "OK" on the Dialog the changes should be saved, and if I click "Cancel" the changes will be dismissed. If row editing for a row is activated and I can change the values in a row, and then I click "Ok" on a Dialog, the active changes in a row will be lost. How can I retrieve an actual status of editing ? How can I know if a row in a datatable is currently edited ? If i know that I can warn User that the changes will be lost.

Edit: link to PF sources Grepcode: PF sources isEditingRow()

<p:dialog>
  <h:form>
     <p:tabView cache="false" id=.. binding=..>
         <p:tab>
            <p:dataTable binding=.. id=... widgetVar=... var=.. >
            </p:dataTable>
         </p:tab>
     </p:tabView>
         <p:commandButton process="@form" action="myBean.listener()" value="OK" update="@form"
           onstart="anotherTable.filter()" />

  </h:form>
</p:dialog>

Edit: I accepted the answer because I implemented the required feature myself.

1

1 Answers

0
votes

Either you bind the component to your backing bean, or write your own buttons that trigger editing mode which will also set a flag in the backing bean that you can use to determine the status of editing.

Binding the component is probably the easier option...