ERDFlowDelegate Class Reference

Inherits com::webobjects::directtoweb::NextPageDelegate.

Collaboration diagram for ERDFlowDelegate:

Collaboration graph
[legend]

List of all members.

Public Member Functions

WOComponent currentComponent ()
final WOComponent nextPage (WOComponent sender)
WOComponent page ()
WOSession session ()

Protected Member Functions

String pageName ()
void setCurrentComponent (WOComponent current)

Package Functions

protected< T > T page (Class<?extends T > clazz)
protected< T > T parent (Class<?extends T > clazz)

Private Attributes

WOComponent _current


Detailed Description

Simple class that makes creating flows of pages a bit easier. Instead of the normal (sender instanceof ...) in nextPage(), you can implement methods nextPageFromSomePageConfiguration() or nextPageFromPageNameOfCurrentPage(). For example:
 public class CreateAssetWithSelectionDelegate extends ERDFlowDelegate {

    public WOComponent nextPageFromSelectAssetGroups() {
        ERD2WListPage page = parent(ERD2WListPage.class)
        if(page.selectedObjects().count() > 0)
           ...
           return D2W.factory.pageForConfigurationNamed("CreateAsset");
        return page.pageWithName("MaybeNextTimePage");
    }

    public WOComponent nextPageFromCreateAsset() {
        ERD2WInspectPage page = parent(ERD2WInspectPage.class)
        if(page.wasObjectSaved())
           return page.pageWithName("ThankYouPage");
        return page.pageWithName("MaybeNextTimePage"); 
    }
 }

 ...
   D2WPage page = D2W.factory.pageForConfigurationNamed("SelectAssetGroups");
   page.setNextPageDelegate(new CreateAssetWithSelectionDelegate())
 ...

 

Author:
ak

Member Function Documentation

WOComponent currentComponent (  ) 

Returns the current component.

final WOComponent nextPage ( WOComponent  sender  ) 

Calls up nextPageFrom + pageName()

protected<T> T page ( Class<?extends T >  clazz  )  [package]

Returns the page cast as the supplied clazz.

Parameters:
<T> 
clazz 

WOComponent page (  ) 

Returns the current page.

String pageName (  )  [protected]

Returns either the pageConfiguration of the topmost page or the name of the topmost page.

protected<T> T parent ( Class<?extends T >  clazz  )  [package]

Returns the innermost enclosing component that extends the supplied clazz.

Parameters:
<T> 
clazz 

WOSession session (  ) 

Returns the session.

void setCurrentComponent ( WOComponent  current  )  [protected]

Set the current component.

Parameters:
current 


Member Data Documentation

WOComponent _current [private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:42:53 2012 for Project Wonder by  doxygen 1.5.8