środa, 5 października 2016

Primefaces Datatable with editable rows, add button and remove button

So the goal is to implement something like that:







So as you can see we have editable component. It is possible to add new row. When the row is being edited Apply button is disabled and also when you add new row the row is automatically set to edit mode.
Let's take a look at the implementation:
This is an implementation of a from containing datable:

As you can see we used jsf compositions here. Take a look at the implementation of datatable:

And finally bean implementation:

Notice that Remove button inside third column is in the same line as Edit, Check and Close buttons. This is not a default behaviour - in order to achieve that you need to add following css:

1 komentarz: