or better yet, override onconfigure() and call setvisible/enabled from there

-igor

On Wed, Oct 20, 2010 at 10:04 AM, Jeremy Thomerson
<jer...@wickettraining.com> wrote:
> On Wed, Oct 20, 2010 at 12:00 PM, Andrei Razin <rukusv...@hotmail.com>wrote:
>
>>
>> Sorry for the Type:
>>
>> I meant:
>> My problem is: "setEnabled" does not take iModel as argumet.
>> I'd like to do something like setEnabled(new PropertyModel(doc,
>> "canDelete")
>>
>
> override isVisible instead:
>
> @Override
> public boolean isVisible() {
>  return getModelObject().canDelete();
> }
>
> remember that if you reference doc directly in your isVisible method, it
> will be serialized, so it's better to give the component a
> loadabledetachablemodel and reference it through the model object as shown
> (depending on what doc is - I'm assuming you won't want it serialized, but
> you may not care depending on where this is).
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to