7 Replies Latest reply on May 28, 2010 11:43 AM by mpickell

    rich:calendar Safari support?

      Hello,

      I'm running into a slight problem with both the mac and windows versions of safari as well as chrome. My rich:calendars work except for any where I use a custom dataModel. It works great on all other browsers, just not webkit based ones. Webkit browsers won't even pop up the date picker. I even tried the nightly webkit builds. Is anyone else experiencing this problem? Is there a work around?

        • 1. Re: rich:calendar Safari support?
          nbelaevski

          Hi,

          Please check if there are any warnings/error on browser console. Some information about your data model items will also be helpful.

          • 2. Re: rich:calendar Safari support?

            Hi,

            The error in the console in Chrome is: Uncaught TypeError: Cannot call method 'doSwitch' of undefined

            Safari just says: Undefined.

            My data model items are pretty much just a copy and paste of the example ones on the richfaces site. I just use some code to figure out if that day should be enabled or not. However, I do not set anything else on the item besides the style and disabled.

            protected CalendarDataModelItem createDataModelItem(Date date) {
             CalendarDataModelItemImpl item = new CalendarDataModelItemImpl();
             Calendar c = Calendar.getInstance();
             Calendar blockedCal = Calendar.getInstance();
             c.setTime(date);
             item.setDay(c.get(Calendar.DAY_OF_MONTH));
             boolean enabled = true;
            
             for (int i = 0; i < disabledDates.size(); i++) {
             blockedCal.setTime(disabledDates.get(i));
             if (blockedCal.get(Calendar.YEAR) == c.get(Calendar.YEAR) && blockedCal.get(Calendar.MONTH) == c.get(Calendar.MONTH) && blockedCal.get(Calendar.DAY_OF_MONTH) == c.get(Calendar.DAY_OF_MONTH)) {
             enabled = false;
             }
             }
             item.setEnabled(enabled);
             if (!item.isEnabled()) {
             item.setStyleClass("cal-disabled");
             }
             return item;
             }



            • 3. Re: rich:calendar Safari support?

              I just did some more testing. It's only one of my rich:calendar controls that I'm having a problem with. I'm not sure what that problem is. The control that isn't working is on my add page so I copied and pasted my edit page into my add page to see if that would fix the problem, but the control still won't work. I've got some further testing to do, so I'll do that and report back.

              • 4. Re: rich:calendar Safari support?

                Ok, after a little bit more testing the edit page works in Safari, but still not in chrome. The error message is:

                Uncaught TypeError: Object [object HTMLInputElement] has no method 'getStyle' http://localhost:8080/ELC-war/faces/a4j/g/3_2_2.SR1org/richfaces/renderkit/html/scripts/calendar.js (line 22)

                • 5. Re: rich:calendar Safari support?
                  nbelaevski
                  • 6. Re: rich:calendar Safari support?

                    Thanks for the reply, gotta love bugs.

                    I'm still not sure what's causing the Undefined error in my add page. I'll do some more testing on it and see if I get anywhere.

                    • 7. Re: rich:calendar Safari support?
                      mpickell

                      I know this is an old one, but i was seeing something maybe related and thought i'd add some info.

                       

                      I was trying to add a calendar inline with text inside a paragraph (p tags).  In firefox and IE this works fine, but in Chrome and Safai (webkit browsers?)  it doesn't.  by not working, I mean that pressing the calendar image does not bring up the calendar.

                       

                      I looked at the html output for chrome and firefox using firebug and chrome's developer tools.  It appears that while firefox is ok with the DIVs nested in the calendar component and allows them to stay inside the parent span tags, chrome allows everything to stay except the DIVs... those are pushed outside of the paragraph tags -- so it pulls apart the component i guess.

                       

                      not sure if this is related to the original issue but i thought it may help with reproducing it if it was.

                       

                      To fix it, i used a div tags instead of paragraphs to wrap the section and changed the CSS to match the look i wanted.  I was trying to be a little semantically correct, but i couldn't here.