public class ERDObjectSaveDelegate extends Object implements com.webobjects.directtoweb.NextPageDelegate
NextPageDelegate
implementation that saves the editing context of an enterprise
object before returning the next page. This can be particularly
handy for example if you want a user to confirm an action before
the editing context is committed, for example:
public WOComponent confirmSave() {
ConfirmPageInterface cpi = (ConfirmPageInterface)D2W.factory().pageForConfigurationNamed("ConfirmSaveUserChanges", session());
cpi.setConfirmDelegate(new ERXObjectSaveDelegate(user, context().page()));
cpi.setCancelDelegate(someCancelDelegate);
return (WOComponent)cpi;
}
This way if the user selects the confirm button the editing context
will be saved and they will be brought back to the current page.Constructor and Description |
---|
ERDObjectSaveDelegate(com.webobjects.eocontrol.EOEnterpriseObject object,
com.webobjects.appserver.WOComponent nextPage)
Public constructor
|
Modifier and Type | Method and Description |
---|---|
protected com.webobjects.eocontrol.EOEditingContext |
editingContext()
returns the editing context of the object.
|
com.webobjects.appserver.WOComponent |
nextPage(com.webobjects.appserver.WOComponent sender)
Implementation of the NextPageDelegate interface
First saves the changes in the object's editing
context and then returns the nextPage.
|
protected com.webobjects.eocontrol.EOEnterpriseObject |
object()
returns the object.
|
public ERDObjectSaveDelegate(com.webobjects.eocontrol.EOEnterpriseObject object, com.webobjects.appserver.WOComponent nextPage)
object
- to be savednextPage
- to be returnedprotected com.webobjects.eocontrol.EOEnterpriseObject object()
protected com.webobjects.eocontrol.EOEditingContext editingContext()
public com.webobjects.appserver.WOComponent nextPage(com.webobjects.appserver.WOComponent sender)
nextPage
in interface com.webobjects.directtoweb.NextPageDelegate
sender
- component calling the delegateCopyright © 2002 – 2020 Project Wonder.