asked
2015-07-06 17:50:53 +0800
javiut 90 ● 1 ● 5 I have a code a like this.
public final class CustomCheckBox extends Checkbox
{
private static final long serialVersionUID = 721911981209434340L;
private final Logger log = Logger.getLogger(getClass());
public CustomCheckBox()
{
super();
log.info("BEFORE1");
addEventListener(-10000,Events.ON_CREATE,new EventListener<Event>(){
public void onEvent(final Event event)throws Exception
{
log.info("onCreateJavaCalled");
}
});
log.info("AFTER1");
return;
}
And in a ZUL something like this
<listcell sclass="textColumn"><customcheckbox onCreate='System.out.println("ZUL onCreateCalled..")'/></listcell>
The ZK documentation says
Notice:
If the priority equals or is greater than 1000, the event listener will be invoked before the event handlers registered in a ZUML page (i.e., the onXxx attribute declared in ZUML). On the other hand, if the priority is lower than 1000, it is invoked after the ZUML's event handler.
The priority registered by addEventListener(String, EventListener) is 0.
Applications shall not use the priority higher than 10,000 and lower than -10,000 since they are reserved for component development.
But i see in console like this.
BEFORE1
AFTER1
onCreateJavaCalled
ZUL onCreateCalled..
Clearly Java onCreate method which should be last is being called first i think this is because the ZUL onCreate is not being set yet any approach to be my onCreate ZUL method called first.