Does anyone know how to freeze any row in primefaces picklist
Or how to use itemDisabled in
To use itemDisabled, simply set the attribute to an EL expression that returns a boolean value. Using PF's demo on the primefaces website, you can disable a row of a player using a condition on the player pojo like so:
itemDisabled
<p:pickList id="pojoPickList" value="#{pickListBean.players}" var="player" itemDisabled="#{player.name eq 'Messi'}" itemValue="#{player}" itemLabel="#{player.name}" converter="player"/>
The snippet above will disable the option named "Messi" in the pickList. Optionally, you can as well delegate the evaluation to a backing bean method:
<p:pickList id="pojoPickList" value="#{pickListBean.players}" var="player" itemDisabled="#{backingBean.isDisabled(player)}" itemValue="#{player}" itemLabel="#{player.name}" converter="player"/>
Copyright © 2021 Jogjafile Inc.
To use
itemDisabled
, simply set the attribute to an EL expression that returns a boolean value. Using PF's demo on the primefaces website, you can disable a row of a player using a condition on the player pojo like so:The snippet above will disable the option named "Messi" in the pickList. Optionally, you can as well delegate the evaluation to a backing bean method: