This is a fundamental dilemma ;) Also on implementation side somebody
may implement:
1)
isvisible() {
return super.isvisible() && businesslogic.isvisible();
}
or simply
2)
isvisible() {
return businesslogic.isvisible();
}
So if 2) is allowed and recommended, then isvisible is really only
businesslogic test instead of real visibilty check.
**
Martin
2011/2/13 Jeremy Thomerson <[email protected]>:
> I just ran across this nuance this week.... If you have this:
>
> <wicket:enclosure child="comp1">
> <div wicket:id="comp1"></div>
> <div wicket:id="comp2"></div>
> </wicket:enclosure>
>
> Now, say comp1 is invisible, so the whole enclosure is invisible. Now, in
> WicketTester, if you test assertInvisible("comp2"), it will fail because
> technically comp2 *is* visible itself, but it's not really visible because
> its parent is not visible.
>
> So, I want to fix this. My question for the group is, which should I do:
>
> 1 - change assertInvisible to test that it is truly visible (i.e., in
> hierarchy)?
>
> 2 - add a new method, assertInvisibleInHierarchy that tests for actual
> visibility and add to the javadoc for assertInvisible that it only tests the
> actual component's visibility, and not its true visibility (as in, in the
> hierarchy)?
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket? Use Brix! http://brixcms.org*
>