How can I add a title to a disabled icefaces commandbutton?

117 views Asked by At

I would like to display a title (tooltip) on a disabled icefaces commmand button, to explain to the user why the button is disabled. But icefaces seems not to render the title when disabled is true

1

There are 1 answers

0
Narayana Nagireddi On

As a workaround, you can use an image for the button which will have it's title even when the button is disabled.

<ice:commandButton id="cmdBtn" title="Submit Form"
        disabled="#{bean.disabledBtn}" 
        action="#{bean.submitAction}">
    <ice:graphicImage title="#{bean.disabledBtn?
                                'Button disabled':'Button enabled'}" 
        style="border:0; vertical-align:middle;" url="#{bean.btnImgURL}"/>
</ice:commandButton>