CompoundPropertyModel always binds to the component's name as the OGNL expression for accessing the property (see FormInput).
BoundCompoundPropertyModel lets you specify the OGNL expression (it can be something other than the component name -- like below where the componentName is "templateInput" and the OGNL expresssion is "template"... although it could be something more significant like "user.foo[0].template"). with BoundCompoundPropertyModel, you can also bind a conversion type (Class) to the Component and the Converter to/from that Class will be called when the property is retrieved and set.
in other words:
// Simple compound property model where the Component's name IS the OGNL expression
public class CompoundPropertyModel extends AbstractPropertyModel
{
public CompoundPropertyModel(final Object model)
}
// Custom compount property model where an OGNL expression and/or type (Class) can be specified for the property by Component
public class BoundCompoundPropertyModel extends CompoundPropertyModel
{
// Construct with Object bean or IModel
public BoundCompoundPropertyModel(final Object model)
// Bind component to expression and/or conversion type
public void bind(final Component component, final String ognlExpression)
public void bind(final Component component, final Class type)
public void bind(final Component component, final String ognlExpression, final Class type)
}
Gili wrote:
On Sun, 06 Mar 2005 00:57:28 -0800, Jonathan Locke wrote:
model.bind(add(new TextArea("templateInput")), "template");
...
setModel(model);
Why do you need both? I mean, don't both bind the model to a component? Am I missing something here?
Gili
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
