I have a zone that is rendered in a loop.  It has a text field that
can be changed and it updates the cost for that row and the total cost
at the bottom of the page.  This all works fine regardless of how many
items are in the row. A user change to the qty in a row will update
that row's total and the total at the bottom of the page.

My code looked something like:
return new MultiZoneUpdate("totalPriceZone",totalPriceZone).add("itemZone-"
+item.getId(), itemZone);

That works fine.

Now the requirements changed and I need to update the total on rows
other than the row that was changed.  My first through was something
like this:
MultiZoneUpdate update =  MultiZoneUpdate("totalPriceZone",totalPriceZone)
for(Item item : getItems) {
   update.add("itemZone-" +item.getId(), itemZone);
}
return update;

But that doesn't work.  It only updates the totalPriceZone.  So I
tried going back to what I had before, but this time creating the
Update on one line and then adding the itemZone on the next like this:

MultiZoneUpdate update =  MultiZoneUpdate("totalPriceZone",totalPriceZone)
update.add("itemZone-" +item.getId(), itemZone);
return update;

I expected the code above to have the same result as my original code,
but it doesn't.  It only updates the totalPriceZone.

Should I expect the first piece of code and the last to do the same
thing or is there some reason that you can't call add on the
MultiZoneUpdate after it is constructed?

Any other suggestions on how to create a multizone update when the
number of zones to add vary at runtime?

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to