I have an input text field (h:inputText) for user to enter date and a image link next to it (t:graphic) which is a popup calendar.
I am able to disable the h:inputText based on the users role by calling back bean function userFieldBean and get value of boolean showField and disable the textfield accordingly.
<h:inputText id="d1" value="txt1" disabled="#{userFieldsBean.showField}"/>
I also want to hide or at least disable the popup calendar link if the textfield next to is disabled, but since to hide the t:graphic i need to set the style as Style=display:none i have trouble figuring out how i should do it.
Is it possible to do something like
<t:graphic url="/imgs/cal.gif" id="img1" Style="if("#{userFieldsBean.showField}"==true) return "display:none" else "return:block"".
The above is obviously wrong but i put it in there as I am curious to know the possibilities.
Looking forward to your suggestions.
Is the t:graphicImage you are using a tomahawk component? If so there is a rendered attribute on the component, you cam do the following:
If you have to set a style you should be able to do something like: