com.boylesoftware.cb2.presentation.servlet
Interface PresentationElement

All Known Implementing Classes:
EmptyForm

public interface PresentationElement

CB2 presentation elements implement this interface.

Version:
$Id: PresentationElement.java,v 1.2 2003/07/20 16:04:19 levahim Exp $
Author:
Lev Himmelfarb

Method Summary
 void init(ActionContext actionCtx)
          Initializes the presentation element.
 void reset()
          Resets fields of the presentation element to their default values.
 

Method Detail

init

public void init(ActionContext actionCtx)
          throws BLException,
                 javax.servlet.ServletException
Initializes the presentation element. This method is called by the framework on presentation elements before they start being used from the JSPs. If a presentation element is included in a transactional page then this method is called from within a database transaction. Multiple presentation elements a initialized in a single transaction if they are included in one page. When this mathod is called all configured presentation element parameters are already set.

Parameters:
actionCtx - the action context.
Throws:
BLException - if an error happened in the business level.
javax.servlet.ServletException - if an error happened during element initialization.

reset

public void reset()
Resets fields of the presentation element to their default values. The exact moment when the system calls this method is undefined, however there is a guarantee that is will be called before any init method call, which also means that it is not necessary to set default values to the fields in the constructor.

This method is especially usefull for optional input parameters. If an optional parameter (the required attribute is set to false in the parameter descriptor) is not present in the specified scope, the system does not do anything, it does not call any setter and leaves the respective bean's property untouched. Therefore, setting a value in the reset method is the only way to set the default value for an optional input parameter.



Copyright © 2002,2003,2004 - Boyle Software, Inc.