-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all,
i'm using the calendar component on zk version 3.6.3.
my code is based on the calendar documentation example ... and honestly i have the same problem with the example itself.
it works fine only if I use firefox but with iexplorer it doens't load the css ... as i result i cannot see buttons and other things.
i have found the same problem using a plain html component when i put a table with css inside ... it works fine only in firefox but not in iexplorer.
is there anything i can do to solve the problem.
many thanks in advance.
kar
Hi,kar
This is my test code
<zk> Calendar:<calendar/> <separator/> Timebox: <timebox cols="14" format="a hh:mm:ss" onCreate="self.value = new Date()"/> <separator/> Datebox: <datebox cols="20" format="yyyy/MM/dd a hh:mm:ss" onCreate="self.value = new Date()"/> <separator/> </zk>
Here is what i have done :
the GenericForwardComposer calls:
>>> Executions.createComponents("calendar.zul", centerDiv, sessionScope);
The calendar.zul ... is as follows:
<?page title="Calendario interventi" contentType="text/html;charset=UTF-8"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="calendarWin"?>
<?component name="CreateDialog" macroURI="createEntry.zul"?>
<?component name="UpdateDialog" macroURI="updateEntry.zul"?>
<?component name="divtab" macro-uri="divtab.zul"?>
<?component name="divarrow" macro-uri="divarrow.zul"?>
<zk>
<style src="calendar.css"/>
<window id="calendarWin" border="none" apply="com.ingegnitech.sosweb.calendar.controllers.NewsController" height="100%" width="100%">
<CreateDialog id="creationDialog" />
<UpdateDialog id="updateDialog" />
<borderlayout>
<center title="Calendario interventi">
<calendars firstDayOfWeek="Monday" timeZone="California=PDT-8" model="@{calendarWin$composer.getCalendarModel}" mold="default" id="cal">
<toolbar sclass="calendar-toolbar">
<separator orient="vertical"/>
<div class="float-left">
<hbox>
<divarrow type="arrow-left" command='cal.previousPage();Events.postEvent("onCreate", label, null);'/>
<divarrow type="arrow-right" command='cal.nextPage();Events.postEvent("onCreate", label, null);'/>
<div>
<button mold="os" label="Interventi di oggi" onClick='cal.setCurrentDate(java.util.Calendar.getInstance(cal.getDefaultTimeZone()).getTime());Events.postEvent("onCreate", label, null);'/>
<label id="label">
<attribute name="onCreate">
Date b = cal.getBeginDate();
Date e = cal.getEndDate();
java.text.SimpleDateFormat sdfV = new java.text.SimpleDateFormat("dd/MM/yyyy", org.zkoss.util.Locales.getCurrent());
sdfV.setTimeZone(cal.getDefaultTimeZone());
self.setValue(sdfV.format(b) + " - " + sdfV.format(e));
</attribute>
</label>
<toolbarbutton label="Aggiorna" class="refresh" onClick='cal.invalidate();'/>
</div>
</hbox>
</div>
<div class="float-right">
<hbox>
<divtab command='cal.mold = "default";cal.days = 1;Events.postEvent("onCreate", label, null);FDOW.visible=false;' text="Giornata"/>
<divtab command='cal.mold = "default";cal.days = 7;Events.postEvent("onCreate", label, null);FDOW.visible=true;' text="Settimana"/>
<divtab command='cal.mold = "default";cal.days = 5;Events.postEvent("onCreate", label, null);FDOW.visible=false;' text="5 Giorni"/>
<divtab command='cal.mold = "month";Events.postEvent("onCreate", label, null);FDOW.visible=true;' text="Mese"/>
</hbox>
</div>
</toolbar>
</calendars>
</center>
<south title="Elenco pratiche" collapsible="true" open="false" splittable="true" flex="true">
<div>
<include src="dossier.zul" height="300px"/>
</div>
</south>
</borderlayout>
</window>
</zk>
This is my sample code
index.zul
<?page title="new page title" contentType="text/html;charset=UTF-8"?> <zk> <window title="new page title" border="normal" apply="ctrl.MyComposer"> <div id="centerDiv" height="600px"/> </window> </zk>
package ctrl; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.util.GenericForwardComposer; import org.zkoss.zul.*; public class MyComposer extends GenericForwardComposer { Div centerDiv; @Override public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); Executions.createComponents("calendar.zul", centerDiv, null); } }
ok i did tried with your example and it works fine for me …
but …
the point is …
I have my main component (let’s call it index with the clkassic border layout)
If I render immediately in the center div the calendar everything works fine … (this from the doAlferComposer …)
The point is that I fill the center div as response of a button pressed in the left area of the border layout … (qui correggimi se sbaglio)
The left div is included as external zul page in the left/easet border layout …
Could it be this part of the problem ????
thanks again
kar
Could you post your sample zul
Hi kar,
I have na app like you, I have a bordelayout with menu in the west part and I <include> some content into the center part. I use ZK Calendar 1 RC (for ZK 3.6.3) and it works fine. Which CSS is not loaded, the calendar.css.dsp from zkcalendar.jar or your own css?
Hi alexricci,
that's strange, calendar.css.dsp is loaded even when I not use it. It is loaded always when I put calendar.jar into the WEB-INF/lib. The loading of ZK resouces from JARs is a little bit unusual. Check it by Firebug or a similar tool.
There must be a lang-addon.xml in the calendar.jar with a line
<stylesheet href="~./calendar/css/calendar.css.dsp" type="text/css"/>
Then, ZK tries to load any calendar/css/calendar.css.dsp by getResourceAsStream. That means, the if you have a file of the same name "calendar/css/calendar.css.dsp" in another JAR, strange things may happen. Do you have only one calendar.jar in your WEB-INF/lib?
I use this sample
<?page title="new page title" contentType="text/html;charset=UTF-8"?> <zk> <window title="new page title" border="normal" apply="ctrl.MyComposer"> <borderlayout height="500px"> <center > <div id="centerDiv" height="600px" /> </center> </borderlayout> </window> </zk>
MyComposer.java is the same with before
the calendar.css is loaded
you can check it in firebug
it is in div
I am facing same problem with calendar 3.6. I am unable to see the buttons and arrows even in firefox. calendar.css.dsp I have does not contain the style class "calendar-toolbar", functionality is working, I am unable to see the arrows and buttons. code exactly looks like the way "Kar" is pasted in this conversation. You might have solved this problem, can you please help me? If you send your calendar.css that will be great help to me. In my calendar.css I could not see many classes, that could be the reason for not displaying the widgets
Asked: 2009-12-29 09:53:04 +0800
Seen: 1,730 times
Last updated: May 19 '10