0

I'm using a web application with Prime Faces.

In my datatable, in which a column is an image, I've the pagination. So I never load too many rows.

For each row I've the button "delete row". Here the code

<p:dataTable id="dataTableUploadedImages" var="singleRow">
    ...
    ...
    <p:column headerText="#{msg['azioni']}" width="70">
        <div align="center">
            <p:commandButton icon="ui-icon-trash" 
                             title="delete Row" 
                             ajax="true"
                             action="#{myController.deleteRow(singleRow.id)}"
                             update="dataTableUploadedImages">
            </p:commandButton>
        </div>
    </p:column>
</p:dataTable>

After clicking over the button, the application refresh the entire table instead of simply remove the single row. In this page, refreshing all the rows is expensive (because a column contains an image) and slow down the application.

Is it possible to remove a row without reloading the entire table?

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
Gavi
  • 1,300
  • 1
  • 19
  • 39
  • Possible duplicate of [How to update specific row in dataTable with the updated information from backing bean](https://stackoverflow.com/questions/37208386/how-to-update-specific-row-in-datatable-with-the-updated-information-from-backin) – Jorge Campos Aug 26 '17 at 10:26
  • Not a duplicate question. We're speaking about deletion. Not update – Gavi Aug 28 '17 at 20:33
  • Then the easiest way would be to do it by client side and not use the `update` attribute at all. – Jorge Campos Aug 28 '17 at 21:35
  • Is there some example? Some article to read? – Gavi Aug 28 '17 at 21:37
  • 2
    Take a look at this thread https://stackoverflow.com/questions/170997/what-is-the-best-way-to-remove-a-table-row-with-jquery – Jorge Campos Aug 28 '17 at 21:44
  • And this could easily be added as a 'deleteRow' on the widget... Will implement this the coming day and file a pull request with PrimeFaces – Kukeltje Aug 29 '17 at 07:39

0 Answers0