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

 

 

Component creation

pageWithName(component) requests the creation of a new instance of the component

Both the constuctor and the awake methods are called before control returns from pageWithName(component)

- Thus a component can not assume it has everything it needs during the constructor or the awake method


//Method to return a new page
public Control tocontrol()
{
Control nextPage = (Control)pageWithName("Control");
System.out.println(" Main component invoke action - go to second");

return nextPage;
}

When awake() is invoked you may not know why

  • hyperlink,
  • to receive values,
  • action without response

Component termination

not clear cut

Active while it is processing a request, when the response is to navigate to another component, the first yields control to the second and is no longer active

BUT, browers support backtracking

To revisit recent pages, the session contains a cache of component instances representing the most recent previous responses
A component instance may linger in the cache until it is reactivated to service a backtracking request or until it is replaced by a more recent response component, then it goes away

Cache is a least recently used queue with a default size of 30

Can set cache size in Application constructor

setPageCacheSize(numberOfPages);

If a backtracking request seeks a component that is no longer in the cache a response page is sent to the user telling him that he has backtracked too far.

Framesets are a problem

Pages in the frameset come and when they go they are stored in the cache

If the Frameset is bumped out of the cache then you have problems

To overcome this problem the Session has a permanent page cache that you can use

Tutorial 33 - Component Creation

Tutorial 42 - Control points


 
Page updated August 22, 2004