Your idea of using PostComponentOnBeforeRenderListener sounds good to me, but I didn't understand exactly what you do with this kind of listener.

Once you have checked if component implements IMyPanel, I would call Application.getHeaderContributorListenerCollection() and I would add a header contributor which renders your JavaScript as I suggested in the previous mail.
The code of you IComponentOnBeforeRenderListener should be something like:

.... implements IComponentOnBeforeRenderListener{

    onBeforeRender(Component component) {
        if(component instanceof IMyPanel)
Application.get().getHeaderContributorListenerCollection().add(new IHeaderContributor(){ public void renderHead( IHeaderResponse response)
                                    {
response.renderOnLoadJavaScript("<...your JavaScript...>");
                                    }
            });
    }
}
That's a a good idea but unfortunately my panels extend disjoint class
hierarchies and I can only group them using interfaces.

Any thoughts on how I can use Application listeners to accomplish this?

Thanks,

Alec

On Mon, Jan 23, 2012 at 3:41 AM, Andrea Del Bene<[email protected]>  wrote:



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to