Ittay Dror wrote:
public final Object getModelObject()
    {
        final IModel model = getModel();
        if (model != null)
        {
            // If this component has the root model for a compound model
            if (getFlag(FLAG_HAS_ROOT_MODEL))
            {
// we need to return the root model and not a property of the
                // model
                return getRootModel(model).getObject(null);
            }

            // Get model value for this component
            return model.getObject(this);
        }
        else
        {
            return null;
        }
    }



note the statement: getRootModel(model).getObject(null);

why use null?

I believe it's because of compound models. e.g. when you have compound property model, getObject(Component) returns you the property of the model object which name is sme as component id.
getObject(null) returns you the whole model object.

If you have a form for instance and set it a compoundpropertymodel, the modelObject of the form is the object you put to the model.

but the model objects of components placed into the form are actually properties of the object you set to the model. (as the components will inherit the model from the form)

-Matej


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to