I am working on primefaces application, where I have to implement a functionality to display list of user objects in dropdown and user can select multiple user objects and filter it.
If the user is deleted or inactive I need to display that user value in striked out.
I seen this link and implemented same way but nothing worked
Different colors of options in selectOneMenu (Primefaces)
If I used this below selectManyMenu, dropdown is coming in page load itself, but the dropdown should come when the user selects the dropdown
https://www.primefaces.org/showcase/ui/input/manyMenu.xhtml
As this functionality exist in many places I wrote a custom dropdown:
<cc:interface>
<cc:attribute name="id" required="true"/>
<cc:attribute name="value" required="true"/>
<cc:attribute name="converterId" type="java.lang.String"/>
</cc:interface>
<cc:implementation>
<div class="userCheckBoxMenu">
<div style="display: inline-block; position: relative;">
<p:selectCheckboxMenu
var="t" filter="true" filterMatchMode="contains" showCheckbox="true">
<f:selectItems value="${cc.attrs.value}" var="u" itemLabel="#{myBean.formatUser(u)}" itemValue="#{u}"/>
<p:column>
<h:outputText value="#{myBean.formatUser(t)}" styleClass="#{myBean.isValidUser(t)} ? 'white-background' :'invalid-user-text'" />
</p:column>
<f:converter converterId="converterId" />
</p:selectCheckboxMenu>
</div>
</div>
</cc:implementation>
Dropdown is coming but invalid user value still showing normally, not striked out.
When I see the generated html, for p:selectOneMenu
it's generating table
for the dropdown, but for p:selectCheckBoxMenu
it's generating div
element, and the column is generating another dropdown but it's hidden.
Confused about it, how to handle this situation?
Thanks in advance!!!!!!!