7 Replies Latest reply on Feb 3, 2011 7:49 AM by Murali Krishna

    rich:message tooltip attribute

    Ray Wilson Newbie

      Had anybody been able to get this to work?


      I have validation on fields and only want to display the message as a tool tip.  I just can't seem to get it to work.  What am I doing wrong?


      Here is an example of how I use it.  The image shows when validation fails and doesn't show when validation passes which is good, but there is not tool tip.  I'm using richfaces 3.3.2.SR1.



      I apolgize if this has been asked before but I could not find any topic related to this.  Thanks for any assistance.


      <rich:message id="msgSHRT_DESC" for="SHRT_DESC" tooltip="true" showDetail="false" showSummary="false">


      <f:facet name="passedMarker">


      <rich:spacer id="passSHRT_DESC" width="16"></rich:spacer>




      <f:facet name="errorMarker">


      <h:graphicImage id="errSHRT_DESC" value="/images/error.gif" />






      <h:outputText id="lblSHRT_DESC" styleClass="rich-text-header" style="font-weight: bold;" value="Name"></h:outputText>


      <h:inputText id="SHRT_DESC" style="width: 95%" maxlength="50" value="#{patternTableBean.patternRowBean.shortDescription}" required="true">





        • 1. Re: rich:message tooltip attribute
          Nick Belaevski Master

          Hi Ray,


          According to documentation, "tooltip" is "Flag indicating whether the detail portion of the message should be displayed as a tooltip.". However, you have both showDetail & showSummary set to "false".

          • 2. Re: rich:message tooltip attribute
            Ray Wilson Newbie

            First, thanks for the response Nick.


            Maybe I don't understand the feature.  I don't want to display the detail or summary messages on the page.  I never liked how the standard JSF validation messages would mess up the page formatting.  I wanted the images to show on failed validation and if the user needs to know why they failed, I was hoping to allow them to mouse over to get the message.


            I have tried setting both the showDetail and showSummary attributes to true and they do display the messages but I didn't want that. But even when I did set them to true, I never got the tool tip to display.

            • 3. Re: rich:message tooltip attribute
              Ray Wilson Newbie
              Does anybody know why I can't get tool tip to work?
              • 4. Re: rich:message tooltip attribute
                Ilya Shaikovsky Master

                tooltip just works as for standard JSF message components.


                As I understand your case - you need to define something like that(pseudocode):


                <message for="input" id="message1">

                     <facet name="errorMarker">




                <tooltip for="message1">

                     <message for="input" id="message1"/>


                you could move that to separate facelet so reusing will be simple.

                • 5. Re: rich:message tooltip attribute
                  Ray Wilson Newbie

                  Thanks!!!  That does exactly what I need. 

                  • 6. Re: rich:message tooltip attribute
                    Murali Krishna Newbie

                    Hi Ray Wilson,


                    I Facing the same problem. am desperate looking a solution for not changing the UI layout when there is a validation error.


                    I tried using IIya's pseudocode, but no luck. Could you please provide me actual code of it.


                    Thanks in advance.



                    • 7. Re: rich:message tooltip attribute
                      Murali Krishna Newbie

                      I got it fixed this way!!



                          <rich:message for="#{compId}" showSummary="false" showDetail="false">
                              <f:facet name="errorMarker">
                                  <h:graphicImage id="msg_error_img" value="/images/modal/error.gif">
                                      <rich:toolTip for="msg_error_img">    
                                          <rich:message for="#{compId}" />


                      Let me know If you have a better solution.