It's a well-known behavior and I think it was a design choice. From 'Wicket in Action', page 95:

"In summary: each component without a model searches up its parent hierarchy for an inheritable model. Once the model is found, the component uses its own identifier as is for the property expression needed to query the model. Any other components that lie between the component and the parent with the inheritable model don’t
make a difference."
Hi,

Debugging https://issues.apache.org/jira/browse/WICKET-4941 I found out
that CompoundPropertyModel works only shallow component hierarchy (one
level deep!).
Is this by design ?

I've added a unit test that shows the problem:
https://git-wip-us.apache.org/repos/asf?p=wicket.git;a=commitdiff;h=7042f885;hp=98404f5541fee8064ff01dee7ff7f4209669245c

If you have a container for Person with two children - one for name (Label)
and another for Address (a container). The Address container have its own
children, like street (Label).
With the current impl of CompoundPropertyModel (and Component#initModel())
Wicket tries to find "street" in Person, while it should try
"address.street" in Person.

Anyone with more experience with IComponentInheritedModel could help here ?


Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov


Reply via email to