Project Wonder 2.0

er.directtoweb
Class ERDObjectSaveDelegate

java.lang.Object
  extended byer.directtoweb.ERDObjectSaveDelegate
All Implemented Interfaces:
NextPageDelegate

public class ERDObjectSaveDelegate
extends Object
implements NextPageDelegate

Simple 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:
Assume that you have a User object that has been editinged in a peer context and now you want the user to confirm that they really should save the changes to the editing context, you could have this method:
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 Summary
ERDObjectSaveDelegate(EOEnterpriseObject object, WOComponent nextPage)
          Public constructor
 
Method Summary
protected  EOEditingContext editingContext()
          returns the editing context of the object.
 WOComponent nextPage(WOComponent sender)
          Implementation of the NextPageDelegate interface First saves the changes in the object's editing context and then returns the nextPage.
protected  EOEnterpriseObject object()
          returns the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERDObjectSaveDelegate

public ERDObjectSaveDelegate(EOEnterpriseObject object,
                             WOComponent nextPage)
Public constructor

Parameters:
object - to be saved
nextPage - to be returned
Method Detail

object

protected EOEnterpriseObject object()
returns the object. Useful for subclasses

Returns:
the object

editingContext

protected EOEditingContext editingContext()
returns the editing context of the object. Useful for subclasses

Returns:
the editing context

nextPage

public WOComponent nextPage(WOComponent sender)
Implementation of the NextPageDelegate interface First saves the changes in the object's editing context and then returns the nextPage.

Specified by:
nextPage in interface NextPageDelegate
Parameters:
sender - component calling the delegate
Returns:
the nextPage component passed in via the constructor.

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.