On Mon, 14 Jan 2008, Beyonder Unknown wrote: > I was wondering what is the best practice when referencing components inside > an onClick/onSubmit. Normally: > > public void onClick(AjaxRequestTarget target) { > //do things here. > //update these components. > target.addComponent(panelA); > target.addComponent(panelB); > > } > > But what if you don't have direct access to PanelA or PanelB?
As far as I know, there is currently no single recommended way of doing this. We've tried abstract callback methods and different ajax-update-listener objects but have found all of them left wanting. Sometimes something like this getPage().visitChildren(PanelA.class, new IVisitor() { ... target.addComponent(component); ... } might work and we've used a more generic solution along those lines as well. You can also search the list on this, one thread was called something like "inter component events". Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations Oy <URL: http://www.ri.fi/ > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]