0

ZK Calendar Error

asked 2010-09-07 16:25:52 +0800

marcelodecampos gravatar image marcelodecampos
183

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.

delete flag offensive retag edit

2 Replies

Sort by » oldest newest

answered 2010-09-08 23:08:23 +0800

pdavie gravatar image pdavie
97 3

updated 2010-09-08 23:11:02 +0800

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

link publish delete flag offensive edit

answered 2010-09-08 23:28:32 +0800

pdavie gravatar image pdavie
97 3

I found a partial solution in this thread. The solution was to download the ZK Calendar 2.0.1 release from here.

Hope that helps others who may have the same problem.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-09-07 16:25:52 +0800

Seen: 215 times

Last updated: Sep 08 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More