| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| Daniel, I've done something like this. Basically, I create fields in the repetition where the name of the field (as in the 'name' field in the static inspector) is a well-known value with an index, like 'calcField0', 'calcField1', etc. Then, I load up some _javascript_ that will recalculate these fields, and make sure that any field that's part of the calculation has _javascript_ function that recalcs. I set the field names by having a method in my WOComponent subclass like this: public String distFieldName() { return "dist"+distIndex; } The distIndex is an indexer on the repetition (the 'index' attribute of the repetition): distributions: WORepetition { item = distribution; list = editingPayment.distributions; index = distIndex; } Then, your _javascript_ can do something like: function recalcDists() { var total = 0.00; var max = document.addressbookForm.elements.length; var index = 0; while (index < max) { if (document.addressbookForm.elements[index].name.length > 4) { if (document.addressbookForm.elements[index].name.substring(0,4) == "dist") { total = total + eval(document.addressbookForm.elements[index].value); } } index++; } document.addressbookForm.totalDist.value = custRound(total,2); } Good luck! Ken On Jul 30, 2007, at 12:59 PM, Daniel Brajkovic wrote:
|
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/email@hidden This email sent to email@hidden
| References: | |
| >Running Totals (From: Daniel Brajkovic <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.