google-code-export / zkcalendar

Automatically exported from code.google.com/p/zkcalendar
1 stars 1 forks source link

Initialization problem for more than one calendars in a tabbox #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If you try to add more than one calendar to tabbox/tabpanel, the second
tab's calendar does not initialise properly. 

In my case I can see the event but they seem to be in the wrong timezone.
When I click on the today button it initialises properly and then works as
expected.

Original issue reported on code.google.com by jean...@gmail.com on 11 Mar 2010 at 7:57

GoogleCodeExporter commented 9 years ago
Hi jeanher,
I tested the latest jar 
it worked on this sample

<zk>
<zscript>

SimpleCalendarModel cm = new SimpleCalendarModel();
SimpleCalendarModel cm2 = new SimpleCalendarModel();
</zscript>
    <tabbox>
        <tabs>
            <tab label="aa" />
            <tab label="bb" />
        </tabs>
        <tabpanels>
            <tabpanel height="700px" width="900px">
            <calendars firstDayOfWeek="Sunday" 
timeZone="Stockholm=Europe/Stockholm" mold="default" model="${cm}">
                <attribute name="onEventUpdate">
                    CalendarsEvent evt = (CalendarsEvent) event;

                    org.zkoss.calendar.Calendars cal = 
(org.zkoss.calendar.Calendars)evt.getTarget();
                    SimpleCalendarModel m = 
(SimpleCalendarModel) cal.getModel();
                    SimpleCalendarEvent sce = 
(SimpleCalendarEvent) evt.getCalendarEvent();
                    sce.setBeginDate(evt.getBeginDate());
                    sce.setEndDate(evt.getEndDate());
                    m.update(sce);
                </attribute>
                <attribute name="onEventCreate"><![CDATA[
                    CalendarsEvent evt = (CalendarsEvent) event;
                    SimpleCalendarEvent ce = new 
SimpleCalendarEvent();
                    ce.setHeaderColor("#A32929");
                    ce.setContentColor("#D96666");
                    ce.setBeginDate(evt.getBeginDate());
                    ce.setEndDate(evt.getEndDate());
                    ce.setContent("new");
                    ce.setLocked(false);
                    cm.add(ce);
                ]]></attribute>
            </calendars>            
            </tabpanel>
            <tabpanel height="700px"  width="900px">
                    <calendars firstDayOfWeek="Sunday" 
timeZone="Stockholm=Europe/Stockholm" mold="default" model="${cm2}">
                <attribute name="onEventUpdate">
                    CalendarsEvent evt = (CalendarsEvent) event;

                    org.zkoss.calendar.Calendars cal = 
(org.zkoss.calendar.Calendars)evt.getTarget();
                    SimpleCalendarModel m = 
(SimpleCalendarModel) cal.getModel();
                    SimpleCalendarEvent sce = 
(SimpleCalendarEvent) evt.getCalendarEvent();
                    sce.setBeginDate(evt.getBeginDate());
                    sce.setEndDate(evt.getEndDate());
                    m.update(sce);
                </attribute>
                <attribute name="onEventCreate"><![CDATA[
                    CalendarsEvent evt = (CalendarsEvent) event;
                    SimpleCalendarEvent ce = new 
SimpleCalendarEvent();
                    ce.setHeaderColor("#A32929");
                    ce.setContentColor("#D96666");
                    ce.setBeginDate(evt.getBeginDate());
                    ce.setEndDate(evt.getEndDate());
                    ce.setContent("new");
                    ce.setLocked(false);
                    cm2.add(ce);
                ]]></attribute>
            </calendars>    
            </tabpanel>
        </tabpanels>
    </tabbox>
</zk>

Original comment by jimmyshi...@gmail.com on 17 Apr 2010 at 4:12