New Component

asked 2010-03-12 04:59:51 +0800

satishkumar gravatar image satishkumar


we have our own framework that is based on javascript for creating components (Textbox, Button etc) and event for that component. Now i want to integrate that in ZK framework as new coponent. But the problem is in existing framework has visual and event of the component is in single js file.

seprating display and event is a bit difficult. As i believe for creating a new component in ZK display(have to put in Mold folder web/js/mycomp/mold/*.js) and event (web/js/mycomp/*.js) is identified sepratly.

I need a help how can i integrate this. Can i have component related event & display in single js file and use it as new component in ZK.

Satish Kumar

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2010-03-12 06:52:42 +0800

satishkumar gravatar image satishkumar


One more add-on to above context. When i create a new component exmp

component.MyComp = zk.$extend(zk.Widget, {}, {});

On a html page "window" is the topmost node. so how is the hirearchy of this new component. how is the control passes from window to zk.Object to this MyComp?

Satish Kumar

link publish delete flag offensive edit

answered 2010-03-15 05:25:32 +0800

Cogito gravatar image Cogito
66 1
ZK Team

Hi Satish,

For you first question, you could just use your single js file, the "mold" folder is not a necessity; however, your component will lose the ability to have multiple molds and you will need to implement a redraw function in your single js file.
An example of a redraw function:
redraw: function(out){
out.push('<div', this.domAttrs_(), '>');

for(var w = this.firstChild; w; w = w.nextSibling)



For your second question, consider:

zk.Object <-- zk.Widget <-- zul.Widget <-- zul.inp.InputWidget
zk.Object <-- zk.Widget <-- zul.Widget <-- zul.LabelImageWidget <-- zul.mesh.HeaderWidget


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




Asked: 2010-03-12 04:59:51 +0800

Seen: 331 times

Last updated: Mar 15 '10

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