Update Datatable line after Celledit primefaces event!

Asked

Viewed 174 times

0

I’m updating a datatable cell, it has 3 columns, description, current price and old price. I can normally call the bean to make the change and save to the bd. However, I can’t update the record in the datatable. I can’t update the "Row" of the q cell I’m sending. I tried through , I tried through Requestcontext, but I was unsuccessful in both.

    <p:dataTable var="tabela" 
value="#{cad012Bean.listaCptTerceirizadaServico}" 
editable="true" editMode="cell"
id="listadeServicosTerceirizados"
emptyMessage="Sem registro para mostrar"
widgetVar="#{widgetVar}" rowIndexVar="rowIndex">

    <p:ajax event="cellEdit" listener="#{cad012Bean.onCellEdit}" update=":listadeServicosTerceirizados" />

    <p:column headerText="Serviço" filterBy="#{tabela.descricao}" filterMatchMode="contains">
        <h:outputText value="#{tabela.descricao}"  />
    </p:column> 
    <p:column headerText="Valor atual"> 
        <p:cellEditor>
                <f:facet name="output">
                        <h:outputText value="#{tabela.valor}" id="e"/>
                    </f:facet>
                    <f:facet name="input">
                        <p:inputText value="#{tabela.valor}"/>
                    </f:facet>
            </p:cellEditor>
     </p:column> 
     <p:column headerText="Valor anterior">
        <h:outputText value="#{cad012Bean.retornaValorAnterior(rowIndex)}" />
     </p:column> 
</p:dataTable>
  • You want to update <p:inputText value="#{tabela.valor}"/>?

  • No, I want to update the previous value. the method returns Value(rowIndex) that it has in value, it takes the list and takes the last value. The list on the back ta being updated, but on the front no.

  • Post your entire form please.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.