|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IModel
A IModel wraps the actual model Object used by a Component. IModel implementations are used as a facade for the real model so that users have control over the actual persistence strategy. Note that objects implementing this interface will be stored in the Session. Hence, you should use (non-transient) instance variables sparingly.
AbstractModel
, or use the simple model wrapper Model
directly.
IDetachable.detach()
, so that interface implementers can detach
transient information when a model is no longer being actively used by the
framework. This reduces memory use and reduces the expense of replicating the
model in a clustered server environment. To implement a detachable model, you
should generally extend AbstractDetachableModel
instead
of implementing IModel directly.
For example, a Form might have a Person model and then a TextField might have a PropertyModel which is the "name" property of the Person model. In this case, PropertyModel will implement getNestedModel(), returning the Person model which is the root model of the property model.
getObject(Component)
method is called, the value returned
will depend on the Component which is asking for the value. Likewise, the
setObject(Component, Object)
method sets a different property
depending on which Component is doing the setting. For more information on
CompoundPropertyModels and model inheritance, see
CompoundPropertyModel
and Page
.
Component.sameRootModel(wicket.Component)
,
Component.sameRootModel(IModel)
Method Summary | |
---|---|
IModel |
getNestedModel()
Gets the nested model. |
java.lang.Object |
getObject(Component component)
Gets the model object. |
void |
setObject(Component component,
java.lang.Object object)
Sets the model object. |
Methods inherited from interface wicket.model.IDetachable |
---|
detach |
Method Detail |
---|
IModel getNestedModel()
java.lang.Object getObject(Component component)
component
- The component which wants to get a model Object
void setObject(Component component, java.lang.Object object)
component
- The component which wants to set a new model Objectobject
- The model object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |