What I do is have the enclosed component trigger an event. That event returns a MultiZoneUpdate object that I handle in the event callback and add the enclosed component to. I then return a MultiZoneUpdate object containing both the ids and bodys of the two components to be updated from the event handler in the enclosed component. looks like this:

parent component (update some navigation pane):

Object onUpdateNavigation()
{
    if (request.isXHR())
        return new MultiZoneUpdate("navigationZone", navigationZone.getBody());

    return null;
}

enclosed component:

@CommitAfter
Object onSuccess()
{
    session.saveOrUpdate(value);

    ComponentEventCallback<Object> callback = new 
ComponentEventCallback<Object>() {

        public boolean handleResult(Object result)
        {
            update = (MultiZoneUpdate) result;

            return false;
        }

    };

    componentResources.triggerEvent("updateNavigation", null, callback);

    if(request.isXHR())
        return update.add(zoneId, componentResources.getComponent());

    return null;
}

HTH,

Uli

Am 02.11.2009 19:35 schrieb lmhill:
I have a component with a zone in it. Inside the zone is an embedded
component which also contains a zone. The main zone is a customer detail
page, while the inner component shows a list of contacts and has a link to
mark one as the primary contact. The customer details include the primary
contact name and phone number if one is selected.

I cannot find a way to get both the detail zone and the embedded contacts
zone to update when selecting a primary contact. I tried using multizone
updates, but the embedded component cannot update a zone it does not
contain.
How do I fire an event on a component from an embedded component?

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

Reply via email to