org.apache.wicket.model
Class ComponentPropertyModel

java.lang.Object
  extended by org.apache.wicket.model.AbstractReadOnlyModel
      extended by org.apache.wicket.model.ComponentPropertyModel
All Implemented Interfaces:
java.io.Serializable, IClusterable, IComponentAssignedModel, IDetachable, IModel

public class ComponentPropertyModel
extends AbstractReadOnlyModel
implements IComponentAssignedModel

A model that references a property by name on the current model of the component it is bound to. This enables direct usage of inherited models such as compound property models.

Author:
Jonathan Locke
See Also:
Serialized Form

Constructor Summary
ComponentPropertyModel(java.lang.String propertyName)
          Constructor
 
Method Summary
 java.lang.Object getObject()
          Gets the model object.
 IWrapModel wrapOnAssignment(Component component)
          This method is called when the component gets its model assigned.
 
Methods inherited from class org.apache.wicket.model.AbstractReadOnlyModel
detach, getObject, setObject, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.wicket.model.IModel
setObject
 
Methods inherited from interface org.apache.wicket.model.IDetachable
detach
 

Constructor Detail

ComponentPropertyModel

public ComponentPropertyModel(java.lang.String propertyName)
Constructor

Parameters:
propertyName - The name of the property to reference
Method Detail

getObject

public java.lang.Object getObject()
Description copied from interface: IModel
Gets the model object.

Specified by:
getObject in interface IModel
Specified by:
getObject in class AbstractReadOnlyModel
Returns:
The model object
See Also:
AbstractReadOnlyModel.getObject()

wrapOnAssignment

public IWrapModel wrapOnAssignment(Component component)
Description copied from interface: IComponentAssignedModel
This method is called when the component gets its model assigned. WARNING: Because the model can be assigned in the constructor of component this method can also be called with a 'this' of a component that is not fully constructed yet.

Specified by:
wrapOnAssignment in interface IComponentAssignedModel
Returns:
The WrapModel that wraps this model
See Also:
IComponentAssignedModel.wrapOnAssignment(org.apache.wicket.Component)


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.