**The Question:**  

In ZK, when working with custom components, what is the best time in the life-cycle to build the component's contents (arbitrarily complex). That is, when can we safely assume we have all data from the view but without waiting too long.

**The Details:**  

In ZK, I can create a custom component `MyCoolComponent`:

```
package my.package;

public class MyCoolComponent extends Div {

  private String title;

  public MyCoolComponent() {
    Selectors.wireVariables(this, this, Div.class);
    Selectors.wireComponents(this, this, false);
    Selectors.wireEventListeners(this, this);
  }

  public String getTitle() {
    return title;
  }

  public void setTitle(String title) {
    this.title = title;
  }

  // When is the correct time to call this function?
  public void initializeComponent() {
    appendChild(new Label(title));
    // arbitrarily complex initialization follows ..
  }

}

```

I can use my custom component in a zul file like so:

```
<?component name="coolcomponent" class="my.package.MyCoolComponent" ?>
<zk>
  <coolcomponent id="cool" height="200px" title="Sean is Cool" />
</zk>

```

Now, when this `Component` is used I want to add children `Components`, for example, by calling the `initializeComponent` function in `MyCoolComponent`.

In the world of `Composers` we are taught to handle all of this kind of work in the `After Compose` phase of the life-cycle with the [`doAfterCompose`](http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/select/SelectorComposer.html#doAfterCompose%28T%29) function. Is the same true for a `Component` created like this? If so, what is the best (read: efficient, safe, readable) way to do so? I feel like attaching a `@Listen` for the `onRender` event is sloppy. Any thoughts?