okay, done refactoring IModel per Jan's comment. see checkin comment for details.
i have not yet gone through all the components to optimize Form models and the constructors yet. however, those changes will be fairly straightforward. we really just need X(String name) and X(String name, IModel model) for each component (which is what i wanted all along! thanks, jan!) as people will probably rarely use anything but BoundCompoundPropertyModel in the future since it's both very convenient and very efficient.
anyway, if a Form is given a BoundCompoundPropertyModel, bindings can be set on that model and the children of the form can then just construct with a name and no model (X(String name)) and they'll end up using the form's model. we'll make this change by changing Form.initModel() to something like this:
protected IModel initModel()
{
if (getParent() != null)
{
// Get form model
final IModel model = getForm().getModel();
if (model != null)
{
return model;
}
else
{
throw new WicketRuntimeException("FormComponent " + this + " and parent Form "
+ getForm() + " cannot both have null models");
}
}
return null;
}
but i don't want to do that tonight though since it's late and the change needs to be made carefully and tested... and it will still break a bunch of stuff most likely...
jon
------------------------------------------------------- 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
