Setting title for checkbox in primefaces datatable

2019-09-14 03:50发布

I want to set titles for checkboxes in a primefaces datatable with a multiple selection column. As an example I use a snippet of the primefaces showcase (http://www.primefaces.org/showcase/ui/data/datatable/selection.xhtml).

<p:dataTable id="checkboxDT" var="car" value="#{dtSelectionView.cars6}" selection="#{dtSelectionView.selectedCars}" rowKey="#{car.id}" style="margin-bottom:0">
    <p:column selectionMode="multiple" style="width:16px;text-align:center"/>
</p:dataTable>

The column in this table is filled with generated checkboxes and I wonder if there is a (declarative) way to set the titles of these checkboxes (for example: select item #itemName). I need the titles for reasons of accessibility, so that a screenreader user knows which element is selected.

Thx in advance!

0条回答
登录 后发表回答