Search code examples
jsfprimefacespicklist

Customize the text of the PickList buttons of PrimeFaces


I would like to know if anyone who has faced this has been able to change the text of the buttons of a picklist. Sometimes due to accessibility problems we may need change it for do this requirement.

The selection buttons of a picklist appear with icons but in the primefaces documentation I don't see how they can be changed text or if it is not possible.

[Updated: I am using Primefaces version 6.2]

picklist


Solution

  • You can simply use the labelDisplay="inline" property.

    <p:pickList ...
                labelDisplay="inline"/>
    

    This will use the default properties of a supported language. See for example the English properties.

    You can customize the labels like:

    <p:pickList ...
                addLabel="Voeg toe"
                addAllLabel="Voeg alles toe"
                removeLabel="Verwijder"
                removeAllLabel="Verwijder alles"
                labelDisplay="inline"/>
    

    or override the properties. See

    See also: