PrimeFaces CommandButton allows you to specify an icon:
<p:commandButton value="Press me" icon="redBall" ... />
However, I need to enable / disable the icon depending on the bean property managed by JSF.
I tried
<p:commandButton value="Press me" icon="#{bean.iconClass}" ... />
This works to select different icons, but it does not completely disable the icon (i.e. get the same rendering as without the icon=
attribute). I can return an empty string to getIconClass()
, but PrimeFaces will still display additional <span>
for the icon inside the button, and the CSS style makes this range visible with the default icon.
Is there a way to tell PrimeFaces βI don't want any icon at allβ (except for the icon=
attribute at all)?
source share