On Tue, Jul 20, 2010 at 12:29 PM, jcgarciam <jcgarc...@gmail.com> wrote:
>
> I guess what Martin and James talk about is having a FeedbackPanel at the
> top and a lot component (panels) ajaxified which only update the
> FeedbackPanel  on their callbacks. Therefore they pass the FeedbackPanel on
> every Panel constructor.
>
> Martin, James am i right?
>

You're exactly right for my specific usecase.  Consider this example.
I've got a Person class which contains an address property of type
Address.  Now, Address is re-used in my domain model in a lot of
places (Vendor, Customer, etc.).  So, everywhere we want to edit an
Address, we want it to use the same interface.  So, I create an
AddressEditorPanel which to re-use on any form which contains an
Address object.  So, now consider a page which is for editing a Person
object.  I create a Form<Person> and on that I put an
AddressEditorPanel which will be used to edit the person's address
(new AddressEditorPanel("address") if using a CPM).  Let's say the
AddressEditorPanel does some AJAX-based validation (for the zip code
perhaps).  I want all my errors on that page to show up on the
FeedbackPanel located at the top of the page.  If I have a validation
error on the zip code, I need to tell the AjaxRequestTarget that I
want the feedback panel updated via AJAX, but how do I do that?  I
need a reference to the FeedbackPanel.  Where do I get it?  Well, I
either have it passed in to me or I look up my hierarchy and do it
that way.  Using the auto-add feature (with a listener), it's handled
for me automagically!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to