Main Menu
Lecture 1
Lecture 3
Lecture 4
Lecture 5
Lecture 6
Lecture 7
 

 

 

The three parts to a generic action method

1. QuotePage newpage = (QotePage)pageWithName("QuotePage");

Get a new component for the response - i.e. retrieve the next page

QuotePage is a WOComponent

2. newpage.setSymbol("AAPL");

Initialise the component - configure the page

You customise the action method

NOTE: the awake method is executed before this initialisation code

3. return newpage;

Return the component

WOBuilder generates above code except part 2

Bind the action to a hyper link

Code generated when action returns null

public WOComponent reload()
{
return null;
}

Which needs to be changed to :

public WOComponent rollDice()
{
return context().page();
}


 

Page updated August 17, 2004