Share February 2009: Project of the Month

ZK - Simply Ajax and Mobile

Tracker: Bugs

5 onCreate added in doAfterCompose not running - ID: 2808240
Last Update: Comment added ( henrichen )

If you use doAfterCompose to add an onCreate event listener to a component
it wont run. If you add an empty zscript onCreate to the component then the
onCreate registered in the doAfterCompose will run. The attached demo
project has two files addListenerTest1.zul and addListenerTest2.zul which
use the same TestComposer which programmatically adds onCreate. On version
has no zsript onCreate and the other has empty zkscript onCreate.


Simon Massey ( simon_massey ) - 2009-06-18 08:45

5

Closed

Invalid

Nobody/Anonymous

General

3.6.1

Public


Comments ( 2 )

Date: 2009-06-22 06:25
Sender: henrichenProject Admin

The UiEngineImpl post onCreate event one by one if there was onCreate
listener when parse the zul file; thus the child components is already
"parsed" and therefore "miss" the opportunity to post the event (since
eventlistener is added later in doAfterCompose).

A "formal" way might be implement FullComposer in the composer so
doAfterCompose is called with each child component and make the timing
correct. Otherwise, have to put an empty onCreate to make UiEngineImpl to
post the event, then the later added event listener in doAfterCompose()
will be called in event handling phase.

We will not change the implementation of UiEngineImpl because of the
backward compatibility.


Date: 2009-06-22 01:26
Sender: jumperchenProject Admin

Please take a look at the Lifecycle of Composer -
http://docs.zkoss.org/wiki/An_Introduction_of_ZK_Composer#Appendix

After the composer ran, the children have already created. But, in the zul
file the onCreate event will be registered by parsing the zul file.


Attached File ( 1 )

Filename Description Download
zktodo2.zip addListenerTest1.zul addListenerTest2.zul Download

Changes ( 4 )

Field Old Value Date By
status_id Open 2009-06-22 01:26 jumperchen
resolution_id None 2009-06-22 01:26 jumperchen
close_date - 2009-06-22 01:26 jumperchen
File Added 331416: zktodo2.zip 2009-06-18 08:45 simon_massey