-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi!
I´m getting up with ZK Calendar which is a must have feature in any application. Every form im my system is created using CreateComponents.
this is the java code that is able to create zul pages inside a border layout center object (parent).
protected void gotoPage( String uri, Component parent, Map parameters ) { if ( parent != null ) { try { if ( SysUtils.isEmpty( parent.getChildren() ) == false ) parent.getChildren().clear(); } catch ( NullPointerException e ) { e = null; } Executions.getCurrent().createComponents( uri, parent, parameters ); } else { redirect( uri ); } }
this is the page
<?xml version="1.0" encoding="UTF-8" ?> <zk xmlns="http://www.zkoss.org/2005/zul"> <div width="100%" height="100%" id="rootParent"> <borderlayout id="borderLayout"> <north autoscroll="false" height="65px" fulfill="=/resources/title.zul"></north> <center> <calendars mold="default" id="cal" firstDayOfWeek="Sunday"></calendars> </center> </borderlayout> </div> </zk>
It works fine for every first time that I create a calendars, but I can´t create any other components - cleanning all childs first - because I got this error in javascript
Object #<an Object> has no method 'destroy'
So, I really don´t know what I´m missing!!!
Thanks in advance.
I am having the same issue (sort of). If anyone can shed light on how to dynamically load and unload a <calendars> object, I'd be really grateful.
I'm taking a slightly different approach, I'm using GenericForwardControllers in a Window to manage the children.
The code that "contains" the calendar looks like this:
<panel> <panelchildren> <include id="content" src="calendars.zul" /> </panelchildren> </panel>
In the forward controller I catch button events that display different components. i then set the "Src" property to the ZUL file to display.
You can do this from within the containing ZUL file too, by using onClick=""SOME ZUL FILE"". But I prefer to separate clearly display and logic, hence the GenericForwardController.
This works fine for all other components EXCEPT ZK Calendar??!!!?? :-) Help!
Thanks in advance,
Peter
Asked: 2010-09-07 16:25:52 +0800
Seen: 215 times
Last updated: Sep 08 '10