简体   繁体   中英

How to makes a Rich ToolTip in JSF visible or not visible?

i have a question concerning rich:toolTip component. I have the following jsf code:

<rich:toolTip followMouse="true" >
    <h:outputText value="#{messages.dto.Station}" escape="false" converter="bbCodeConverter" />
</rich:toolTip> 

This ToolTip works grateful, but it will be sign a empty tooltip, if messages.dto.Station is empty too. How can i solve this problem in that way, that the tooltip is not visible, if messages.dto.Station is empty?

Thanks for helping me !

Greetz Marwief

<rich:toolTip followMouse="true" 
  rendered="#{messages.dto.Station !=null or messages.dto.Station !=''}" >
  <h:outputText value="#{messages.dto.Station}" 
    escape="false" converter="bbCodeConverter"/>
 </rich:toolTip>

Using the rendered attribute will help you to only show when your #{messages.dto.Station} is not empty rich faces doc link

In JSF 1.2 you can use the rendered attribute as @BholaVishwakarma has described.

That should work on JSF 1.2 also

Here is a free tip for you. You should avoid using uppercase letters on beans. messages.dto.Station . It should be messages.dto.station

Try the following

<rich:toolTip followMouse="true" 
  rendered="#{messages.dto.Station !=null and not empty messages.dto.Station}">
...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM