// It must have a Page, otherwise one of its parents has been
// removed. No Page, than disable the attribute modifier and
// return the attribute value unchanged.
// Component.findPage() is 'protected'. But this works as well.
if (!(behaviorOwner instanceof Page) && behaviorOwner.findParent(Page.class) == null)
{
setEnabled(false);
return currentValue;
}