I use the next construction very often:
[markup]
<wicket:enclosure child="something">
<p>Something here, description, comments etc: <span
wicket:id="somethinig"></span></p>
</wicket:enclosure>
[java]
add(new Label("something")
{
@Override
public boolean isVisible() {
return super.isVisible() && getDefaultModelObject() != null;
}
});
And there are a lot different components which should be hidden with
some arounding text if they have null value of model object.
How to make this more elegant?
First obvious way - inherit from Label, and make something
LabelInvisibleNull, but it is very bad, because a lot different
components (not only Label, but Image, WebMarkupContainer, some my
custom components, etc) require this behavior.
Second - more meaningful - make a IBehavior. But it doesn't work. In
"bind" is to early to check model, but in "beforeRender" is too late
to change visibility.
Is there any other option?
--
WBR, kan.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]