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: > Why not make an abstract MyPanel and provide an implementation of renderHead > method (from IHeaderContributor)? > I mean something like: > > public abstract class MyPanel extends Panel{ > > public void renderHead(Component component, IHeaderResponse response) > { > response.renderOnLoadJavaScript("<...your JavaScript...>"); > } > } > > >> Hello, >> >> What is the best way to execute some Javascript code when components >> of type IMyPanel render? >> >> I was hoping that I could use >> Application#addPostComponentOnBeforeRenderListener(..) and add a >> listener that would add a behavior to each component of IMyPanel type. >> The behavior would then execute append some Javascript in >> onComponentTag() method. However, I can't seem to find the right type >> of behavior to attach or maybe I should use a different >> Application#addXXXListener(..) method. >> >> Please help. >> >> Thanks, >> >> Alec >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
