Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: modifying the save method for WO Display Group



Hi, Mat,

There are many places you can save the original value of transactionptDisplayGroup.selectedObject.passThroughAmt. I often override appendToResponse for this.

If you override takeValuesFromRequest, the return from super.takeValuesFromRequest, will be the first place that all the values entered by the user should be available to you. Before you return from the overriding method, you can do all the arithmetic you want to those values. However, don't do anything that will change the structure of the template, since invokeAction hasn't yet been called.

Regards,
Jerry

On Oct 9, 2006, at 5:36 PM, email@hidden wrote:

I would like to know how to add a little math to the save method of a Display Group.

I am using a display group to access records for modifying. The returned records are displayed in Strings and one to be edited is displayed in a Field. The user will enter a number into the field and invoke the save component:

public WOComponent saveChanges()
{
try {
this.session().defaultEditingContext().saveChanges();
} catch (Exception e) { // could be more specific...
NSLog.err.appendln( "ViewEditInformation: saveChanges: save error: " + e.getMessage() );
msg = "There was an error saving your changes: " + e.getMessage();
return null;
}
msg = "Changes saved.";
return null;
}


The value they are modifying is called "transactionptDisplayGroup.selectedObject.passThroughAmt". I would like to know how to take the user's entered value and add 15 to it prior to the save. Then I would like to take the value of "transactionptDisplayGroup.selectedObject.passThroughAmt" before their edit and subtract from it the value the user entered with the added 15 and set the value of another field of the displayed group, "transactionptDisplayGroup.selectedObject.salonPtRec". Finally, I would like to save the results to the DB.

Any help would be nice. Thanks,
--Mat
______________________________________________________________________ __
Check out the new AOL. Most comprehensive set of free safety and security tools, free access to millions of high-quality videos from across the web, free AOL Mail and more.


_______________________________________________
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/jerrywwalker% 40gmail.com


This email sent to email@hidden


--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial Strength Internet Enabled Systems


    email@hidden
    203 278-4085        office



_______________________________________________
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: 
 >modifying the save method for WO Display Group (From: email@hidden)



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.