0

ZK Lifecycle : doAfterAllComponentsComposed ?

asked 2015-06-05 10:12:38 +0800

FlorianSchaetz gravatar image FlorianSchaetz flag of Germany
31 6

Hi,

is there a method I can override to get a "doAfterAllComponentsComposed" functionality? At the moment, I am trying to create a highly flexible application (where I can't even rely on the structure, as it might change for some cases) which requires to exchange some includes based on GET-Parameters, etc.

The basic idea is to first create the page (using includes atm) based on GET-Parameters, etc. and then apply the composers to initialize the whole interactivity. But at the moment, these two things seem to bring some problems together...

I first tried to replace components in the doAfterCompose method, but this leads to the problem that Component a gets composed, Component b adds a forward to a and then a gets replaced with a_2 - but b's forward still points at a.

So I next tried to replace the src attribute of include tags in the doBeforeCompose method, which at least prevents the creation of a completely, but also here, the doAfterCompose of some composers is called before some other composers even reach doBeforeCompose, leading to the problem that they try to access a component that doesn't event exist yet.

So, is there a method I can call to do my initialization and be sure that all components on the tree have already been composed? Of course I could, for example, send an event from the root component and listen for that in all composers to do the initialization, but somehow that smells wrong.

Does anyone have a good and clean way to do something like this?

Regards,

Flo

delete flag offensive retag edit
Be the first one to answer this question!
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

Follow
1 follower

RSS

Stats

Asked: 2015-06-05 10:12:38 +0800

Seen: 7 times

Last updated: Jun 05 '15

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