The trade-off is that if you save the parent EC form the related EC, you may 
save an edit on the parent that the user is not expecting. In most cases I 
agree with you and I have implemented a true save on the related component to 
reduce the user confusion about the "double save".


On 2013-07-12, at 8:33 AM, Theodore Petrosky <[email protected]> wrote:

> when I create a new to-many object there is a button with a  label 'Save'. I 
> understood that this new object was inserted into the EC and I had to click 
> the save button at the bottom of my parent EO to actually save the related 
> object.
> 
> but of course there is a problem. If I add an object and immediately click 
> its delete button, my app throws a hissy-fit because the object can not be 
> deleted as it is not saved in the first place.
> 
> So the question is. when I create a new object, and click save, shouldn't d2w 
> do just that? saveChanges() on the EC?
> 
> this is the saveButton's action (from ERMODWizardCreationPage).
> /**
>  * Performs submit action. Overridden to reset the nested validation setting 
> on the
>  * object.
>  */
>  // FIXME - Is this needed here? davidleber
>  @Override
>  public WOComponent submitAction() throws Throwable {
>   WOComponent result = super.submitAction();
>   if (object() instanceof ERXGenericRecord) {
>      ((ERXGenericRecord)object()).setValidatedWhenNested(true);
>   }
>  return result;
> }
> 
> I keep following back the super.submitAction() to see what it does but there 
> is no implied saveChanges() anywhere that I can find.
> 
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/programmingosx%40mac.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to