On Thu, Jan 20, 2011 at 1:51 PM, Igor Vaynberg <igor.vaynb...@gmail.com>wrote:

> interesting idea. i think this would require a bit of a trick.
>
> a) modify enclosure tag handler to accept an attribute instead of a tag
> b) modify enclosure tag handler to add a bit of metadata to the
> component marking that it belongs to an enclosure
> c) add a ajaxrequesttarget.listener to the request target that checks
> for this bit of metadata and adds the enclosure container to the ajax
> request target.
>
> not sure how feasible this all is because the enclosure container is
> an auto component. but, you are welcome to tinker around.
>
> -igor


I, too, like the idea.  Couldn't it be simpler?  Couldn't he:

1: Override newAjaxRequestTarget in WebApplication
2: When he creates an ART, add a listener to it.
3: In the listener, in onBeforeRespond, do this:

for(Component component : map.values()) {
    Enclosure parentEnclosure = component.findParent(Enclosure.class);
    while (parentEnclosure != null) {
        Enclosure topParent = parentEnclosure.findParent(Enclosure.class);
        if (topParent != null) {
            parentEnclosure = topParent;
        }
    }
    if (parentEnclosure != null) {
        addComponent(parentEnclosure);
    }
}



-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*

Reply via email to