-
FEATURED COMPONENTS
First time here? Check out the FAQ!
hi, I'm elemetry developver Andrew..
I used GenericForwardComposer Class. please help me..
Java
public class MyClass extends GenericForwardComposer{ public void onCreate$myPanel(Event event) { alert("onCreate ME!!"); } }
<zul> <window apply="MyClass"> <tablelayout> <tablechildren> <panel id="myPanel"> </panel> </tablechildren> </tablelayout> </window> <zul>
Hi,
I thinks the onCreate event is not triggered at wanted timing,
you need doAfterCompose method to help you bind all components,
please refer to the smalltalk
http://docs.zkoss.org/wiki/ZK_MVC_Made_Easy
the sample code MyComposer6.java may help.
Thanks, hideokidd
that's sample is implementing Composer.
i already did that in GenericForwardComposer..
in detail,,
public class MyClass extends GenericForwardComposer{ public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); }
Hi,
I encountered the same case,
but it's interesting that forward event works,
please try
java
public void onCreatePanel(Event event) { alert("onCreate ME!!"); }
zul
<panel id="myPanel" forward="onCreate=onCreatePanel">
Thanx again.
That's very good idea for me.
Then, I encounter the another problem.
In your second solution, "forward attribute" call the "onCreate" method before components rendered completely.
in your method,
public void onCreatePanel(Event event) { alert("onCreate ME!!"); }
public void onCreatePanel(Event event) { alert("onCreate ME!!"); myPanel.setVisible(false); }
hi,
I'm mistake,
your method is right.
<<forward="onCreate=onCreatePanel">>
That's good iead!
I've solved this problem.
By the way, why did the event handler couldn't catch "onCreate" event?
is this ZK's bug???
thanks "hideokidd"!!
Hi,
I think that's life cycle or composer mechanism issue,
there is a small talk about composer,
http://docs.zkoss.org/wiki/An_Introduction_of_ZK_Composer
maybe zk team will fix the specification problem in the future.
Push.
Are there ideas to do the automatically event forwarding for all components in future?
Done. Thanks Peter.
Asked: 2009-05-13 03:34:29 +0800
Seen: 1,138 times
Last updated: Oct 12 '10