On 3/27/07, Jonathan Locke <[EMAIL PROTECTED]> wrote:
I need access to the getRootModel(IModel) method in my code because I'm
writing an instrospective form component validator which needs to know
what
type the compound model is at attach time. Can we make this method
protected instead of private? (I haven't got commit access still...
hopefully someone at Apache will rescue me soon).
IModel model=component.getModel();
if (model instanceof IWrapModel) {
model=((IWrapModel)model).getNestedModel();
}
Object root=model.getObject();
now root is what you are after no?
Also, it would be nice if ValidationError had a toString method. Currently
I see this in my application:
Could not locate error message for error:
[EMAIL PROTECTED]
I see there's a TODO. I'd fix if I could commit.
i will do this, but do get your commit rights figured out :)
BTW, it's a bummer that the new arrangement of things requires a wrapper for
all the compound property model accessing children. The whole point of
compound property models in the first place was to do dynamic lookup and
avoid the overhead of associating a model with most form children at all.
Is there no way around this? (expect answer is no)
the answer is not no. there might as well be something johan and i
overlooked. do have a looksee or open a jira issue so we wont forget.
-igor
--
View this message in context:
http://www.nabble.com/getRootModel-and-tf3476307.html#a9703410
Sent from the Wicket - Dev mailing list archive at Nabble.com.