Right Martin, so your code allows me to select the children to refresh via
Ajax.

My question was how can trigger the logic processing in the ParentClass
automatically. As you noted in the code, the child panels will have to
remember to call the parent.update(t) line. I'm fine with that solution,
but I was wondering if there was another way.

For example would that page's onBeforeRender get called automatically if a
link's onClick is called?

The more I think about it it feels like I'll use:
parent.update(ajaxReqTarg, PayloadType.MONITOR). Then each child panel will
implement an interface like: 'getPayloadSubscriptions()' and if any report
that they care about 'MONITOR'ing payload they would get added to the
AjaxRequestTarget since each render needs to report what type of payload
update we are looking for..

-Clint


On Wed, Nov 30, 2011 at 1:36 AM, Martin Grigorov <[email protected]>wrote:

> Hi Clint,
>
> I'd recommend to look in AjaxRequestTarget itself.
> It has addChildren(parentInstance, Child.class) method with update all
> children with type Child of this parent.
> Check also AjaxRequestTarget.IListener.
> Or add ParentClass#update(AjaxRequestTarget) so you can do:
> AnotherClass#onEvent(ART t) {...; parent.update(t);...}
>
> On Wed, Nov 30, 2011 at 7:51 AM, Clint Checketts <[email protected]>
> wrote:
> > I want to create a parent panel that will have several child panels. I'm
> > making it so the parent panel will automatically add child components to
> > the AjaxRequestTarget via its logic and detecting which ones it detects
> > need to update. I can see how to make it work great if the AjaxLink calls
> > the parent panel in it's onClick, but is there any method or hook I can
> put
> > in the parent panel itself that would be able to detect that a request is
> > happening and decide to add the child components automatically?
> >
> > I know 1.5 has this, I'm just trying to make it work in 1.4.x for now
> since
> > the planned upgrade to 1.5 is a ways away for this project.
> >
> > Is there a solution without overriding anything in the application class?
> > If it isn't possible, what is the minimum application class changes
> > required? (WebRequestCycleProcessor?)
> >
> > Thanks,
> >
> > -Clint Checketts
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to