this is called model chaining. where models know that their model
object is another model and can properly handle it.
in this particular example
imodel d=getdefaultmodel()
imodel p=new propertymodel(d, "multiply")
p.getobject() then does this
object target=mytarget; (in this case d)
while (target instanceof imodel) { target=imodel.getobject(); }
getproperty(target, property);
so in execution p.getobject() resolves to this: d.getobject().getmultiply();
makes sense?
-igor
On Wed, Jul 20, 2011 at 10:38 AM, [email protected]
<[email protected]> wrote:
> In the wicket example of Form Input (
> http://wicketstuff.org/wicket14/forminput/
> http://wicketstuff.org/wicket14/forminput/ ), I'm looking at the source and
> can't make out what's happening with this line:
>
> // display the multiply result
> Label multiplyLabel = new Label("multiplyLabel", new
> PropertyModel<Integer>(
> getDefaultModel(), "multiply"));
>
> I understand what this accomplishes, but I don't understand how. We're
> passing this property model the default model of what exactly? I don't get
> what it means to pass a property model a sublass of IModel to base itself
> off of.
>
> Thanks,
> mike
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/property-model-question-tp3681616p3681616.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]