Not sure what your goal is to add a child.
But the default widget initialization lifecycle
1.widget. $ init () // JS Widget Constructor
2.widget.redraw _ // output html, this is actually a "mold".
3.widget.bind _ // event binding to html, and the desktop is turned on.
If you plan to create a composite widget, like a calendar in the Date field, you can reference the $ init function in the Date field. :)
Let me know if you need more 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); },
source share