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

    rich:message tooltip attribute

    rwilson9

      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>

       

      <f:facet name="errorMarker">

       

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

       

      </f:facet>

       

      </rich:message>

       

      <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">

       

      <rich:beanValidator/>

       

      </h:inputText>

        • 1. Re: rich:message tooltip attribute
          nbelaevski

          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
            rwilson9

            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
              rwilson9
              Does anybody know why I can't get tool tip to work?
              • 4. Re: rich:message tooltip attribute
                ilya_shaikovsky

                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">

                          <image>

                     </facet>

                </message>

                <tooltip for="message1">

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

                </tooltip>

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

                • 5. Re: rich:message tooltip attribute
                  rwilson9

                  Thanks!!!  That does exactly what I need. 

                  • 6. Re: rich:message tooltip attribute
                    muralib12

                    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.

                     

                    Murali

                    • 7. Re: rich:message tooltip attribute
                      muralib12

                      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}" />
                                      </rich:toolTip>
                                  </h:graphicImage>
                              </f:facet>                                            
                          </rich:message>
                      

                       

                      Let me know If you have a better solution.

                       

                      Thanks