com.fruitioninc.jwc
Interface Model

All Known Subinterfaces:
ButtonModel, HyperLinkModel, LabelModel, ListBoxModel, PageModel, TableModel, TextAreaModel, TextFieldModel
All Known Implementing Classes:
AbstractListBoxModel, AbstractModel, AbstractTableModel, DefaultButtonModel, DefaultHyperLinkModel, DefaultLabelModel, DefaultPageModel, DefaultTextAreaModel, DefaultTextFieldModel, ThreadLocalTextFieldModel

public interface Model

Responsible for the state of a component. Model's can be state-full or non-state-full. By default Models are non-state-full. Non-state-full models are models whose state dies when its enclosing page loses its visibility. On the other hand, the state in state-full models lives on when its enclosing page loses its visibility. The state in state-full models is kept alive by persisting it on the client browser in hidden HTML input elements, cookies or some other client storage mechanism. Do not confuse this persistence with the server side persistence provided AbstractThreadLocalModel.

State is transferred to a model when a HTTP request is received from the client and extracted from it when a HTTP response is sent to the client. Under default operation this process is handled dynamically by the controller using the Java Bean design pattern. When applying state, the controller examines the model for member functions with the following properties:

It then calls these functions to apply the incoming state to the model. When extracting state, the controller examines the model for member functions with the following properties: It then calls these functions to extract the state of the model. The developer must be cognizant of these rules when naming member functions on models.

See Also:
AbstractThreadLocalModel, DynamicModel

Method Summary
 boolean _getStatefull()
          Returns true if this model's state should persist beyond the life its page.
 void _setStatefull(boolean statefull)
          Sets the state of this model's statefullness.
 

Method Detail

_getStatefull

public boolean _getStatefull()
Returns true if this model's state should persist beyond the life its page.


_setStatefull

public void _setStatefull(boolean statefull)
Sets the state of this model's statefullness.

See Also:
isStatefull