Reputation: 54
I would like to use a dynamic tooltip for a commandButton
in an xhtml file, but I am unable to use new-line solutions in the xhtml file. This example works
<f:view xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:commandButton image="/resources/images/1.png" title="Line1
Line2" actionListener="#{varBean.view}" />
</f:view>
but this does not, where var.tooltip = "Line1
Line2"
,
<f:view xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:commandButton image="/resources/images/1.png" title="#{var.tooltip}" actionListener="#{varBean.view}" />
</f:view>
How can I achieve this?
Upvotes: 0
Views: 282
Reputation: 54
Incredible, but I found a solution for my problem (the simpliest way works):
If var.tooltip String = "Line1\nLine2"
then I see newlines in the tooltip :)
Maybe Standard JSF has no facilities for this, but Icefaces 3.2 has, or I do not know who, but it works! I hate that most of my Icefaces and JSF work is trying out different kind of syntax and solutions...
Upvotes: 2