Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6233639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:20:12+00:00 2026-05-24T10:20:12+00:00

First off: I’m fairly new to zk. I try to create a component that

  • 0

First off: I’m fairly new to zk. I try to create a component that does a lot of client side processing (think image editing). Therefore, I would like to create a widget that creates it’s own child widgets at ‘construction time’.

But although I do find a lot of documentation on how to instantiate widgets, I fail to find a hint on when to do it. In other words:

How does ZK call my widget, what method should I override in my widget javascript to generate children?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T10:20:12+00:00Added an answer on May 24, 2026 at 10:20 am

    Not sure what’s your purpose for adding child.

    But by default the widget initialize lifecycle is

    1.widget.$init() //JS widget constructor

    2.widget.redraw_ // output html , it’s actually the “mold” .

    3.widget.bind_ // binding event to html , and the desktop is inited.

    If you are planing to build a composite widget ,
    like the calendar in Datebox , you could reference to the $init function in Datebox. 🙂

    Let me know if you need further information.

    https://github.com/zkoss/zk/blob/5.0/zul/src/archive/web/js/zul/db/Datebox.js

    function _initPopup () {
        this._pop = new zul.db.CalendarPop();
        this._tm = new zul.db.CalendarTime();
        this.appendChild(this._pop);
        this.appendChild(this._tm);
    }
    
    $init: function() {
        this.$supers('$init', arguments);
        this.afterInit(_initPopup);
        this.listen({onChange: this}, -1000);
    },
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off I should forewarn you that I am a new grad(and EE at
First off, I'm working on an app that's written such that some of your
First off, let me start off that I am not a .net developer. The
First off, I apologize if this doesn't make sense. I'm new to XHTML, CSS
First off, a big thanks to the people behind the new boost::geometry library! This
First off, I want to apologize beforehand, as I know there is a lot
First off I am pretty new to C, so I probably just have a
First off, I'm pretty new so I hope I hadn't missed anything too trivial.
First off I apologize if there is another post out there that answers this,
First off, a lil about me, i'm very new to GUI programming, especially with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.