10 Replies Latest reply on Nov 19, 2008 9:57 AM by j-pro

    Calendar and Tooltip problem

      I get a null pointer error if I place a tool tip inside the calendar tag.

      <rich:calendar id="#{id}"
       value="#{value}"
       popup="true"
       datePattern="MM.dd.yyyy"
       buttonIcon="/images/general/1X1.jpg"
       inputClass="#{width}">
       <rich:toolTip rendered="#{! empty errorFieldMessage}">
       <h:message for="#{id}" />
       </rich:toolTip>
      </rich:calendar>
      


      I would like for this message to be displayed over my input field. Previous to this I was using the title parameter to display tootips on input fields, but this is superior.

      Please advise.

      Also is it possible to render the icon as a separate component? The way I lay out my forms calls for relocation of the icon. Currently I am using a 1X1 transparent image with a text field that is not editable so the my layout is not changed. With Seam selectDate below the layout of the icon is able to be controlled.

      <h:inputText id="checkinDate" value="#{booking.checkinDate}" required="true">
       <s:convertDateTime pattern="MM/dd/yyyy"/>
       </h:inputText>
       <s:selectDate for="checkinDate">
       <h:graphicImage url="img/dtpick.gif" style="margin-left:5px;cursor:pointer"/>
       </s:selectDate>


      Actually if it were able to funtion the way the seam date selection worked as an option then both of my problems would be solved.

        • 1. Re: Calendar and Tooltip problem

          I simplifed the tool tip to see if I could find the problem.

          <rich:toolTip>wtf</rich:toolTip>


          I do not get the null pointer by all of the dates are blank and selection is not possible. The month and year navigation does function though.

          I then tried just adding text inside the calendar tag and this was rendered for each cell.



          • 2. Re: Calendar and Tooltip problem

            If it is JSF 1.1 (without Facelets), <rich:toolTip>wtf</rich:toolTip>
            causes the same that:
            <rich:toolTip rendered="#{! empty errorFieldMessage}">
            <h:message for="#{id}" />
            </rich:toolTip>

            I.e., empty content

            • 3. Re: Calendar and Tooltip problem

              Thank you very much for your reply. I am using

              JSF RI 1.2
              Facelets
              Seam 2.0

              How should it behave with this setup?

              • 4. Re: Calendar and Tooltip problem

                It is not a help yet. I just try to figure out where might be the problem before the Dev Team dig into it.

                • 5. Re: Calendar and Tooltip problem
                  maksimkaszynski

                  Sorry for the long delay. At last, I managed to look at it.
                  It is the same as.
                  http://jira.jboss.com/jira/browse/RF-912

                  • 6. Re: Calendar and Tooltip problem

                    Any chance this could be fixed in 3.1.1?

                    • 7. Re: Calendar and Tooltip problem

                      I have added the comment with suggestion. The final decision will depends of how the changes are harmless for the rest of the code.

                      • 8. Re: Calendar and Tooltip problem
                        j-pro

                        Good afternoon.

                        I try to use tooltip in rich:calendar too. But I use RichFaces version v.3.2.2.SR1 SVN $Revision: 10967 $ $Date: 2008-10-29 16:50:25 +0200, which definitely should be with fixed RF-912. But my tooltip doesn't work AND in plus wrecks my calendar: http://tinyurl.com/6y3pam

                        Here is my calendar code:

                        <a4j:region id="calendar_employeeBirthDateEdit" layout="block">
                         <rich:calendar id="employeeBirthDateEdit" value="#{amBean.employee.birthDate}"
                         enableManualInput="#{amBean.calendarEnableManualInput}" popup="#{amBean.calendarPopup}" locale="#{amBean.calendarLocale}"
                         datePattern="#{amBean.calendarPattern}" showInput="#{amBean.calendarShowInput}" required="true"
                         inputClass="inputcalendarfield" requiredMessage="#{constMan.requiredMessage}">
                         <rich:toolTip showEvent="oninputclick" followMouse="true" direction="top-right" delay="500" styleClass="tooltip" style="width:13px">
                         <span style="white-space: nowrap"> UK </span>
                         </rich:toolTip>
                         </rich:calendar>
                        </a4j:region>
                        (UK - is just a test word for simplicity, actually I'll show current date pattern in this tooltip)


                        I use:

                        JSF 1.2_07-b03-FCS
                        facelets-1.1.14
                        jboss-4.2.3.GA with jdk1.5.0_09
                        Firefox 2.0.0.17

                        Can you help me please?

                        Thanks in advance!

                        • 9. Re: Calendar and Tooltip problem
                          j-pro

                          Ok, seems here is a bug somewhere, because tooltip doesn't work with a calendar when it's used in panelGrid (even using not embedded tooltip, like abpve, but JS-call approach):

                          <h:panelGrid columns="9" style="width:100%">
                           <h:panelGroup>
                           <a4j:region id="calendar_employeeBirthDateEdit" layout="block">
                           <rich:calendar id="employeeBirthDateEdit" value="#{amBean.employee.birthDate}"
                           enableManualInput="#{amBean.calendarEnableManualInput}" popup="#{amBean.calendarPopup}" locale="#{amBean.calendarLocale}"
                           datePattern="#{amBean.calendarPattern}" showInput="#{amBean.calendarShowInput}"
                           oninputclick="#{rich:component('calendarParretnTT')}.show(event);"
                           inputClass="inputcalendarfield" />
                           </a4j:region>
                           <rich:toolTip id="calendarParretnTT" followMouse="true" direction="top-right" delay="500" attached="false"
                           styleClass="tooltip" style="width:13px" value="#{amBean.calendarPattern}" />
                           </h:panelGroup>
                          </h:panelGrid>


                          I've already contacted Ilya about it, so probably there will be a JIRA for it. Just for others to know.

                          • 10. Re: Calendar and Tooltip problem
                            j-pro

                            JIRA "Tooltip for calendar doesn't work when used in h:panelGrid" created: https://jira.jboss.org/jira/browse/RF-4986