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*

Reply via email to