1

Ok so I've been messing around with a JSF snippet supposed to render a tooltip :

<ice:form>
    <ice:panelGroup>
        <ice:graphicImage value="images/icon_info.gif" width="15" height="15" style="float:left;"></ice:graphicImage>
        <ice:panelToolTip>
            <f:facet name="body">
                <ice:outputText styleClass="toolTip" escape="false" value="Jeff,IfYoureSeeingThisYoureSmiling"/>
            </f:facet>
        </ice:panelToolTip>
    </ice:panelGroup>
</ice:form>

The problem is that when I hover the tooltip icon, no text-box is displayed. I also noticed that if I add a CommandLink to that snippet (in the panelGroup), the action will never be executed.

My tought on the problem

You must know that the current web page is included in another web page which already have an <ice:form/>. So, I think this may be caused by nested forms, no ? Note that I have no errors displayed.

I wanted to try by removing the <ice:form> but then I get error that it must be in a form. Note that I can't remove the form in the parent web page.

N.B. The JSF is written in an .xhtml file, I know this is not cool but it should work ?

N.B. I'm not in an <ui:repeat/>

Edit : The bean called by the action of the commandLink is RequestScoped but I doubt it does matter in that case as I have other Beans used the same way that are RequestScoped and that works properly.

Mark
  • 16,772
  • 9
  • 42
  • 55
Jean-François Savard
  • 20,626
  • 7
  • 49
  • 76

2 Answers2

1

Have a look at the ICEfaces tooltip showcase. The <ice:panelGroup> has a attribute panelTooltip which should be assigned the id of your <ice:panelTooltip>.

<ice:form>
    <ice:panelTooltip id="myTip">
        <f:facet name="body">
            <ice:outputText styleClass="toolTip" escape="false" value="Jeff,IfYoureSeeingThisYoureSmiling"/>
        </f:facet>
    </ice:panelToolTip>

    <ice:panelGroup panelTooltip="myTip">
        <ice:graphicImage value="images/icon_info.gif" width="15" height="15" style="float:left;" />            
    </ice:panelGroup>
</ice:form>
dkurzaj
  • 346
  • 4
  • 13
Mark
  • 16,772
  • 9
  • 42
  • 55
1

A short research on this topic brought up, that you have to specify the tooltip ID for the text you want to add the tooltip for, similar to

<ice:panelGroup panelTooltip="staticTooltip" >
    <ice:outputText value="Hovering on this text will bring a panelTooltip" />
</ice:panelGroup>

<ice:panelTooltip id="staticTooltip">
    <f:facet name="body">
        <h:outputText value="This panelTooltip is static. It will be closed when the user moves the mouse out of the triggering component" />
    </f:facet>
</ice:panelTooltip>
Smutje
  • 17,733
  • 4
  • 24
  • 41