Java – PrimeFaces customize RowEditor in datatable

javajsf-2primefaces

Is there a way to customize the rowEditor button? I mean if it is possible to change the image or add a text.
If it is not possible, is there a way to obtain the same behaviour with another control like button or link?

Best Answer

Just use CSS. The below example assumes that you want to apply it on all datatables/roweditors and have the desired image files in /resources/images folder.

.ui-datatable .ui-row-editor .ui-icon-pencil {
    background-image: url("#{resource['images/pencil.png']}");
}

.ui-datatable .ui-row-editor .ui-icon-check {
    background-image: url("#{resource['images/check.png']}");
}

.ui-datatable .ui-row-editor .ui-icon-close {
    background-image: url("#{resource['images/close.png']}");
}

See also: