-
FEATURED COMPONENTS
First time here? Check out the FAQ!
public class MyWindow extends Window implements AfterCompose{ private Listbox listbox; private MyComp myComp; // macro component public void onCreate$myWindow() { String str = myComp.getId(); // myComp is null; } }
<window id="myComp" use="MyComp"> <textbox id="tbName" value="@{myObj.name}" width="300px"/> </window>
public class MyComp extends Window { private MyObj myObj; public MyObj getMyobj() { return myObj; } public void setMyobj(MyObj myObj) { this.myObj = myObj; } public void onCreate$myComp() { myObj = new MyObj(); } }
you have to extends org.zkoss.zk.ui.util.GenericForwardComposer, and use apply to associate the composer with your UI component.
Please refer to this article.
/robbie
Asked: 2009-05-21 19:31:33 +0800
Seen: 197 times
Last updated: May 22 '09