public class ERDFlowDelegate extends Object implements com.webobjects.directtoweb.NextPageDelegate
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())
...
Constructor and Description |
---|
ERDFlowDelegate() |
Modifier and Type | Method and Description |
---|---|
WOComponent |
currentComponent()
Returns the current component.
|
WOComponent |
nextPage(WOComponent sender)
Calls up nextPageFrom + pageName()
|
WOComponent |
page()
Returns the current page.
|
protected <T> T |
page(Class<? extends T> clazz)
Returns the page cast as the supplied clazz.
|
protected String |
pageName()
Returns either the pageConfiguration of the topmost page or the name of
the topmost page.
|
protected <T> T |
parent(Class<? extends T> clazz)
Returns the innermost enclosing component that extends the supplied
clazz.
|
WOSession |
session()
Returns the session.
|
protected void |
setCurrentComponent(WOComponent current)
Set the current component.
|
protected void setCurrentComponent(WOComponent current)
current
- public WOComponent currentComponent()
public WOComponent page()
public WOSession session()
protected <T> T parent(Class<? extends T> clazz)
T
- clazz
- protected <T> T page(Class<? extends T> clazz)
T
- clazz
- protected String pageName()
public final WOComponent nextPage(WOComponent sender)
nextPage
in interface com.webobjects.directtoweb.NextPageDelegate
Copyright © 2002 – 2024 Project Wonder.