1 2 Previous Next 21 Replies Latest reply on Feb 24, 2011 9:10 PM by evaldo.junior

    Calendar and ajax

    magbyr

      Hello.

      I'm having problems using the calendar control (3.1.0 RC3) in an ajax form. At first the calendar is not shown. After changing some input field, I update the page through an a4j:support tag. One of the components that's rendered then is an calendar. It's not usable when it's rendered through an ajax call.
      Clicking on it just gives a javascript error:

      $("scoretableform:_id122:1:_id152").component has no properties
      http://localhost:8080/form.jsf
      Line 1

      Also on ajax update I get the following error:

      Prototype.Browser has no properties
      http://localhost:8080/a4j_3_1_0-SNAPSHOTorg.ajax4jsf.javascript.PrototypeScript.jsf
      Line 238

      Is this a known bug?

        • 1. Re: Calendar and ajax

          could you provide the page code snippet? Also, what kind of browser you use?

          • 2. Re: Calendar and ajax
            magbyr

            Tried this one... Getting the same error.

            <a4j:form>
             <h:panelGroup id="test" columns="2" style="width: 300px">
             <h:selectBooleanCheckbox value="#{Test.bool}">
             <a4j:support event="onchange" reRender="test" />
             <f:selectItem itemValue="true" itemLabel="Show" />
             <f:selectItem itemValue="false" itemLabel="Hide" />
             </h:selectBooleanCheckbox>
            
             <rich:calendar value="#{Test.date}" popup="true"
             rendered="#{Test.bool}" />
             </h:panelGroup>
            </a4j:form>
            


            • 3. Re: Calendar and ajax
              magbyr

              Using firefox 2.0.0.6.

              • 4. Re: Calendar and ajax
                ilya_shaikovsky

                just copy pasted your code. works fine.

                My full env:

                JSF 1.2_04
                Facelets 1.1.12
                RF 3.1.0 RC3
                Firefox 2.0.0.6
                tomcat 5.5

                • 5. Re: Calendar and ajax
                  magbyr

                  Ok. Thanks.
                  I'm on MyFaces 1.1.5.
                  Also using Tomahawk for some pages.

                  I'll try to find what is causing the error on my system...

                  • 6. Re: Calendar and ajax
                    ilya_shaikovsky

                    Strange.. After replacing JSF to myFaces - still working for me.. could you please share your war with sources somewhere?,

                    • 7. Re: Calendar and ajax
                      magbyr

                      Strange indeed. I had recently updated the myfaces libs to 1.1.5. When I switched back to 1.1.4, things started working again.

                      Is there a known incompability issue between ajax4jsf and myfaces 1.1.5?

                      • 8. Re: Calendar and ajax

                        I am getting the same error on trying to open a modal panel.

                        I am using JSF 1.2, Seam 2.0, Trinidad, Ricfaces 3.1, and Tomahawk.

                        Any ideas?

                        • 9. Re: Calendar and ajax

                          Also, I am seeing this in IE6 and Firefox 2.0.0.6

                          • 10. Re: Calendar and ajax
                            ilya_shaikovsky

                            could you please simplify as possible your case and provide it?

                            • 11. Re: Calendar and ajax
                              locutusut

                              I resurrecting this thread as I am seeing this issue in RichFaces 3.2.0.SR1. Basically, I have a radio button that show/hides a rich:calender. This works fine, but in IE I need to click the radio button twice. But when the calendar shows up the popup calendar will not show.

                              Please advise if I'm doing something wrong here. I'm using:

                              MyFaces 1.2.2
                              Spring MVC 2.5.4
                              Spring WebFlow 2.0
                              Tomcat 6
                              IE 6/FF 2.0.14

                              TIA,
                              Lou

                               <ui:define name="content">
                               <a4j:form id="landingForm">
                               <h:panelGroup id="supplierInfo" columns="2">
                               <h:selectOneRadio id="initiator" value="#{pcnRequest.qctSupplier}">
                               <a4j:support event="onchange" reRender="supplierInfo" />
                               <f:selectItem id="initiator1" itemLabel="QCT" itemValue="false" />
                               <f:selectItem id="initiator2" itemLabel="QCT Supplier" itemValue="true" />
                               </h:selectOneRadio>
                              
                              
                               <rich:calendar id="supplierShipDate" popup="true" width="100%"
                               rendered="#{pcnRequest.qctSupplier}"
                               value="#{pcnRequest.supplierShipDate}" datePattern="dd-MMM-yy"
                               style="width:200px" enableManualInput="true">
                               </rich:calendar>
                               </h:panelGroup>
                               </a4j:form>
                               </ui:define>
                              


                              • 12. Re: Calendar and ajax

                                try to use event="onclick" instead of event="onchange"

                                • 13. Re: Calendar and ajax
                                  locutusut

                                  Note, I've also tried this on RF 3.2.1.CR1.

                                  • 14. Re: Calendar and ajax
                                    locutusut

                                    Thanks Sergey, but that doesn't address the issue of the calendar's pop-up not rendering.

                                    1 2 Previous Next