class mylabel extends label {
protected boolean isvisible() {
return !Strings.isEmpty(getModelObjectAsString());
}
}
-igor
On Fri, May 23, 2008 at 8:13 AM, greeklinux <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I want to display diffent values. For this purpose I am
> using the Label component with a CompoundPropertyModel.
>
> I want to show user details on a profile page.
> But not all user values are set. So I want to display only
> values that are not empty strings.
>
> I was thinking about to extend the Label class and override
> the isVisible() method. But I do not know how to get the value for
> the Label that will be displayed. The Label gets his value with the
> wicket id as property expression.
>
> ProfileModel gets an user id and loads a user obj. from DB.
>
> class user extends page {
> ...
> CompoundPropertyModel model = new CompoundPropertyModel(new
> ProfileModel(userId));
> setModel(model);
> Label firstName = new Label("firstName");
> add(firstName);
> ...
> }
>
>
> Thanks
> --
> View this message in context:
> http://www.nabble.com/Label-visibility-dependend-on-Model-value-tp17427854p17427854.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]