各要素のツールチップをp:selectManyCheckBox
に追加したいと思います。しかし、私は解決策を思いつくことはできません。pのためのPrimefacesのツールチップ:selectManyCheckbox
"id"(Long)、 "name"(String)、 "description"(String)の3つのプロパティを持つクラスRole
があります。名前が表示され、その説明がツールチップとして表示されます。
これは、コードの作業部分である:
<p:selectManyCheckbox layout="pageDirection" value="#{roleBean.selectedRoles}" converter="roleConverter">
<f:selectItems value="#{roleBean.roles}" var="role" itemLabel="#{role.name}" itemValue="#{role}"/>
</p:selectManyCheckbox>
roleConverter
は、ID及びその逆へRole
に変換FacesConverter
あります。
私はこの思い付いた:
<p:selectManyCheckbox layout="pageDirection" value="#{roleBean.selectedRoles}" converter="roleConverter">
<c:forEach var="role" items="#{roleBean.roles}">
<f:selectItem id="role#{role.id}" itemLabel="#{role.name}" itemValue="#{role}" />
<p:tooltip for="role#{role.id}" value="#{role.description}"/>
</c:forEach>
</p:selectManyCheckbox>
しかし残念ながら、それは動作しません。