1 2 Previous Next 27 Replies Latest reply on Oct 4, 2007 4:46 AM by Olivier Thierry

    Calendar month, year << < > >> not working

    Jason Long Master

      These funtions are not working. I am using it in a modal panel. I can select the date and that works, but << < > >> just closes the window and does change the date.

      Any ideas?

        • 1. Re: Calendar month, year << < > >> not working
          Sergey Smirnov Master

          does it work outside the modal panel ?
          Where is the h:form located?

          • 2. Re: Calendar month, year << < > >> not working
            Jason Long Master

            It does work outside of the modal panel.

            Inside the panel I Firebug gives the following and the calendar closes with no effect.

            obj has no properties
            render()calendar.js (line 114)
            load("", true)calendar.js (line 94)
            updatePagePart(Object _query=Object options=Object containerId=_viewRoot, undefined, "")a4j_3_1_0-SNAPSHO... (line 44)
            after processing updates");window.setTimeout()a4j_3_1_0-SNAPSHO... (line 80)
            [Break on this error] {dataobj=this.days[p];var obj=$(this.params.weekNumberBarId+k);element=obj.first...


            • 3. Re: Calendar month, year << < > >> not working
              Jason Long Master

              I upgraded to 3.1.GA and I have the same problem. All controls on the calendar except clicking on the actual date close the calendar with that error.

              Seam date is working fine, but I was trying to remove as it is now deprecated.

              Also clicking the (x) by the date in the lower left corner of the calendar takes me to a blank page. When I view source there is nothing there.

              • 4. Re: Calendar month, year << < > >> not working
                Yurii Kartsev Apprentice

                Sorry, I didn't see the post... that's why created a new one.

                I have the same problem:

                Using RC6 rich:calendar... Works perfectly, except the month and year changing in Mozilla Firefox 2.0.0.6. When I press arrows for changing month or year, Firebug gives an error: "Richfaces.getComponent is not a function".

                It's strange, because when I tested this component in RF Demo - it worked nice.

                Here is my jsf code:

                <?xml version="1.0" encoding="UTF-8"?>
                <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:h="http://java.sun.com/jsf/html"
                 xmlns:jsp="http://java.sun.com/JSP/Page"
                 xmlns:a4j="http://richfaces.org/a4j"
                 xmlns:rich="http://richfaces.org/rich">
                ...
                
                <h:panelGroup>
                 <a4j:outputPanel id="calendar" layout="block">
                 <rich:calendar id="employeeDocumentDateEdit"
                 value="#{amBean.employee.documentDate}"
                 enableManualInput="#{amBean.calendarEnableManualInput}"
                 popup="#{amBean.calendarPopup}"
                 locale="#{amBean.calendarLocale}"
                 datePattern="#{amBean.calendarPattern}"
                 showInput="#{amBean.calendarShowInput}"
                 required="true"/>
                 </a4j:outputPanel>
                 <h:message style="color: red" for="employeeDocumentDateEdit"/>
                </h:panelGroup>
                
                ...


                And:
                calendarPopup = true;
                 calendarShowInput = true;
                 calendarEnableManualInput = true;
                 calendarPattern = "dd.MM.yyyy";
                 calendarLocale = new Locale("ru/RU");





                And the second notice about rich:calendar. In IE 6 it works, months and years changes well, but it's design is like that: http://www.imagehosting.com/out.php/t1135086_1.PNG


                Thank you very much for your answer.

                P.S.: Sorry that didn't see this post... The previous one can be deleted...

                • 5. Re: Calendar month, year << < > >> not working
                  Sergey Smirnov Master

                  do you have a h:form inside the modal panel?

                  • 6. Re: Calendar month, year << < > >> not working
                    Jason Long Master

                    Here is the facelets template I use for a modal panel.

                    <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                     xmlns:ui="http://java.sun.com/jsf/facelets"
                     xmlns:h="http://java.sun.com/jsf/html"
                     xmlns:f="http://java.sun.com/jsf/core"
                     xmlns:rich="http://richfaces.ajax4jsf.org/rich"
                     xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">
                    
                     <rich:modalPanel id="#{panelId}">
                     <f:facet name="header">
                     <ui:insert name="header" />
                     </f:facet>
                     <f:facet name="controls">
                     <h:graphicImage value="/images/richfaces/close.png"
                     style="cursor:pointer"
                     onclick="Richfaces.hideModalPanel('#{panelId}')" />
                     </f:facet>
                     <a4j:form id="#{formId}">
                     <a4j:outputPanel ajaxRendered="true">
                     <div class="hidden"><h:messages id="error"/></div>
                     <ui:insert name="content" />
                     </a4j:outputPanel>
                     </a4j:form>
                     </rich:modalPanel>
                    </ui:composition>


                    • 7. Re: Calendar month, year << < > >> not working
                      Ilya Shaikovsky Master

                      ok.. and you sure that the modal panel isn't inside any external form? (nested not available)

                      • 8. Re: Calendar month, year << < > >> not working
                        Jason Long Master

                        There are several other forms on the page, but the modal panel is not inside any of them.

                        I will use Seam date for now.

                        Please let me know if you find anything.

                        • 9. Re: Calendar month, year << < > >> not working
                          Nick Belaevski Master

                          Jason,

                          You're using calendar inside ajax-rendered output panel, that's why it is closing on scroll - it just gets re-rendered to initial state. I've filed an issue to investigate appearing JS error: http://jira.jboss.com/jira/browse/RF-931

                          As a workaround I can suggest using new rich:message/messages components then. These component are re-rendered automatically without wrapping inside a4j:outputPanel.

                          • 10. Re: Calendar month, year << < > >> not working
                            Yurii Kartsev Apprentice

                            I'm surprised, but I've got it magically working... I don't know why, but I didn't change the code... There is no more JS errors with RC6. Can't understand why.

                            • 11. Re: Calendar month, year << < > >> not working
                              Olivier Thierry Apprentice

                              I have the same problem on FF 2.0.0.6 (not on IE 6). But I have no message in Firebug.

                              My XHTML file :

                              <html
                               xmlns:s="http://jboss.com/products/seam/taglib"
                               xmlns:ui="http://java.sun.com/jsf/facelets"
                               xmlns:f="http://java.sun.com/jsf/core"
                               xmlns:h="http://java.sun.com/jsf/html"
                               xmlns:rich="http://richfaces.org/rich"
                               xmlns:a="http://richfaces.org/a4j">
                              
                              <ui:composition template="templates/template.xhtml">
                              <ui:define name="body">
                               <h:messages globalOnly="true" styleClass="message"/>
                               <rich:panel>
                               <f:facet name="header">Demande d'absence - Sélection de la période</f:facet>
                               <h:form id="demande">
                               <h:panelGrid columns="2">
                               <h:outputText value="Date de début :" />
                               <rich:calendar value="#{ligneDemandeAbsence.dateDebut}"
                               datePattern="dd/MM/yyyy"
                               popup="true"
                               locale="#{locale}"
                               enableManualInput="true" />
                              
                               <h:outputText value="Valorisation de début :" />
                               <h:inputText id="valorisationDebut" value="#{ligneDemandeAbsence.valorisationDebut}" required="true" />
                              
                               <h:outputText value="Date de fin :" />
                               <rich:calendar value="#{ligneDemandeAbsence.dateFin}"
                               datePattern="dd/MM/yyyy"
                               popup="true"
                               locale="#{locale}"
                               enableManualInput="true" />
                              
                               <h:outputText value="Valorisation de fin :" />
                               <h:inputText id="valorisationFin" value="#{ligneDemandeAbsence.valorisationFin}" required="true" />
                              
                               </h:panelGrid>
                               <h:commandButton id="cmdSuivant" value="Suivant" action="suivant" />
                               </h:form>
                               </rich:panel>
                              </ui:define>
                              </ui:composition>
                              </html>


                              The response for the request sent by the calendar (thanks Firebug !) :

                              <?xml version="1.0"?>
                              
                              <html xmlns="http://www.w3.org/1999/xhtml"><head><link type="text/css" rel="stylesheet" href="/t4Seam
                              
                              /a4j_3_1_0css/toolBar.xcss/DATB/eAFjlbr0AAAC6gHS" /><link type="text/css" rel="stylesheet" href="/t4Seam
                              
                              /a4j_3_1_0org/richfaces/renderkit/html/css/calendar.xcss/DATB/eAFjlbr0AAAC6gHS" /><script type="text
                              
                              /javascript" src="/t4Seam/a4j_3_1_0org.ajax4jsf.javascript.PrototypeScript">
                              
                              </script><script type="text/javascript" src="/t4Seam/a4j_3_1_0org.ajax4jsf.javascript.AjaxScript">
                              
                              </script><script type="text/javascript" src="/t4Seam/a4j_3_1_0org/richfaces/renderkit/html/scripts/events
                              
                              .js">
                              
                              </script><script type="text/javascript" src="/t4Seam/a4j_3_1_0org/richfaces/renderkit/html/scripts/utils
                              
                              .js">
                              
                              </script><script type="text/javascript" src="/t4Seam/a4j_3_1_0org/richfaces/renderkit/html/scripts/json
                              
                              /json-dom.js">
                              
                              </script><script type="text/javascript" src="/t4Seam/a4j_3_1_0org/richfaces/renderkit/html/scripts/scriptaculous
                              
                              /effects.js">
                              
                              </script><script type="text/javascript" src="/t4Seam/a4j_3_1_0org/richfaces/renderkit/html/scripts/calendar
                              
                              .js">
                              
                              </script><meta name="Ajax-Update-Ids" content="" /><title></title></head><body><span id="ajax-view-state"
                              
                              ><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="_id8" /></span>
                              
                              <meta id="Ajax-Response" name="Ajax-Response" content="true" /></body></html>


                              Any idea ?

                              • 12. Re: Calendar month, year << < > >> not working
                                Olivier Thierry Apprentice

                                More informations on my problem, and it really turns to X-Files ! Colleagues of mine tried to access the page where I inserted my calendar component : they can choose a date in the past ... but not in the future ! From my browser, I can't choose a date either in past or future. What is even more strange os that we have the same browser (FF 2.0.0.6), the same default locale in the browser (french, but the problem is exactly the same with english), the same OS (Windows XP) and we navigate exactly the same way in the app ! We removed all files from the browser cache and the problem is still the same.

                                • 13. Re: Calendar month, year << < > >> not working
                                  Olivier Thierry Apprentice

                                  Am I the only guy in the world having this problem ?

                                  • 14. Re: Calendar month, year << < > >> not working
                                    Ilya Shaikovsky Master

                                    We already have the bug that influence your case.

                                    The all you need to fix it temporarily - surrond your calendars with region. Because the submit shouldn't be completed because of the required input. Now calendar just not work in ajaxSingle mode.

                                    B.t.w.

                                    h:messages globalOnly="true" styleClass="message"

                                    will not show you ajax caused messages. Use rich:messages component instead.

                                    1 2 Previous Next