4 Replies Latest reply on Oct 27, 2009 6:39 AM by gamba

    rich:message tooltip=true not shown

    gamba

      Hi,

      I want to show a error-message as tooltip for a <h:inputText> field. With a static text it works, the global <rich:messages> tag also renders the same message on the page, but the tooltip with the same message is empty at every time ...

      ...
      <rich:column id="columnPersonNr" rendered="#{props.attributes['name'].value == 'Personalnummer'}" width="108px" styleClass="pisColumnClass">
       <h:inputText id="attPersonNr" value="#{props.attributes['value'].value}" tabindex="100" styleClass="pisInputClass"
       onfocus="setActiveBackground(this,false)" onblur="setInactiveBackground(this,false)">
       </h:inputText>
      </rich:column>
      
      <rich:toolTip id="ttAttPersonNr" for="attPersonNr" showEvent="onclick" direction="top-right">
       <rich:message id="msgAttPersonNr" for="attPersonNr" tooltip="true" />
      </rich:toolTip>
      ...
      


      I have a column inside a <rich:dataGrid>. The grid is wrapped with a form, with a region an a <a4j:outputPanel>.

      I don't know what happened here ...

      Thx,
      Gamba

        • 1. Re: rich:message tooltip=true not shown
          ilya_shaikovsky

          It's not placed in the same column with the component to which attached - so it can't find target component because rendered only once and can't evaluated target client id.

          And in general tooltip functionality works just the same as for bas h:message component.

          • 2. Re: rich:message tooltip=true not shown
            gamba

            Thanks but inside the column component it doesn't work for me ...

            neither this ...

            <rich:column id="columnPersonNr" rendered="#{props.attributes['name'].value == 'Personalnummer'}" width="108px" styleClass="pisColumnClass">
             <h:inputText id="attPersonNr" value="#props.attributes['value'].value}" tabindex="100"
             onfocus="setActiveBackground(this,false)" onblur="setInactiveBackground(this,false)">
             </h:inputText>
             <rich:toolTip id="ttAttPersonNr" for="attPersonNr">
             <rich:message id="msgAttPersonNr" for="attPersonNr" tooltip="true" />
             </rich:toolTip>
            </rich:column>
            


            nor that code-snippet ...

            <rich:column id="columnPersonNr" rendered="#{props.attributes['name'].value == 'Personalnummer'}" width="108px" styleClass="pisColumnClass">
             <h:inputText id="attPersonNr" value="#props.attributes['value'].value}" tabindex="100"
             onfocus="setActiveBackground(this,false)" onblur="setInactiveBackground(this,false)">
             </h:inputText>
             <rich:message id="msgAttPersonNr" for="attPersonNr" tooltip="true" />
            </rich:column>
            


            It works only with attaching a value to the tooltip and getting the error-message from the component directly ...

            <rich:column id="columnPersonNr" rendered="#{props.attributes['name'].value == 'Personalnummer'}" width="108px" styleClass="pisColumnClass">
             <h:inputText id="attPersonNr" value="#props.attributes['value'].value}" tabindex="100"
             onfocus="setActiveBackground(this,false)" onblur="setInactiveBackground(this,false)">
             </h:inputText>
             <rich:toolTip value="#{pisValidatorBean.msgPersonalnummer}" id="ttAttPersonNr" for="attPersonNr" />
            </rich:column>
            


            Gamba

            • 3. Re: rich:message tooltip=true not shown
              ilya_shaikovsky

              tried at richfaces-demo sample for inplaceInputs:

               <rich:column>
               <f:facet name="header">
               <h:outputText value="Price" />
               </f:facet>
               <rich:inplaceInput layout="block" value="#{car.price}"
               converterMessage="Price value should be integer. Price at row #{row+1} can't be changed."
               id="inplace" required="true"
               requiredMessage="Price at row #{row+1} wasn't filled. Value can't be changed."
               changedHoverClass="hover" viewHoverClass="hover"
               viewClass="inplace" changedClass="inplace"
               selectOnEdit="true" editEvent="ondblclick">
              
               <a4j:support event="onviewactivated" reRender="table, messages"
               />
              
               </rich:inplaceInput>
               <rich:toolTip for="inplace">
               <rich:message for="inplace"/>
               </rich:toolTip>
               </rich:column>
              


              works fine for me.

              • 4. Re: rich:message tooltip=true not shown
                gamba

                Ok, maybe in my portal-environment with the 1.0.0.CR2 Bridge there are some more issues which could break the default behaviour.

                BTW: I'm generating the error message not in the validation-phase. Instead I validate on my own (for compound-validation, and some other issues ...) and create only the error-msgs to display, without any validator-exceptions ... maybe this causes the problem ... I don't know ...