Thanks, I suppose I should have responded after Thiago mentioned the MultiZoneUpdate a few days back, which did solve the problem for me.

In my case, I have each Component using the triggerEvent method of Component Resources with a Callback to return the proper MultiZoneUpdate. I guess it was hard for me to conceptually understand why I'd need a MultiZoneUpdate to update just a single Zone in the way I wanted, but it works.

Component

public Object returnZone(){
        final Object[] returnObject = new Object[]{null};
        Object[] context = new Object[]{zone};

        cr.triggerEvent("TriggerZoneUpdate",
                context,
                new ComponentEventCallback() {
                        public boolean handleResult(final Object result) {
                            if (result != null) {
                                returnObject[0] = result;
                            }

                            return result != null;
                        }
                });

        return returnObject[0];
}

Containing Page

public Object onTriggerZoneUpdate(Zone zoneForUpdate){
return new MultiZoneUpdate(zoneForUpdate.getClientId(), zoneForUpdate);
}

On 05/17/2011 12:23 PM, Mark wrote:
You probably want to build a multizone update to update just the necessary
zones.  Here is a snippet of some of my code that updates zones only if they
are visible in that particular context:

    public MultiZoneUpdate getPriceMultiZoneUpdate() {

         MultiZoneUpdate update = new MultiZoneUpdate("totalPriceZone",
totalPriceZone);

         if(isSubtotalVisible()) {

             update = update.add("subtotalZone", subtotalZone);

         }



         if(isDiscountVisible()) {

             update = update.add("totalDiscountsZone", totalDiscountsZone);

         }



         if(isSalesTaxVisible()) {

             update = update.add("totalSalesTaxZone", totalSalesTaxZone);

         }



         if(isFulfillmentFeeVisible()) {

             update = update.add("totalFulfillmentFeeZone",
totalFulfillmentFeeZone);

         }


         return update;




     }



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

Reply via email to