Hi, you can override the isEnable method and implement your rule, like:

new BookmarkablePageLink
{
      boolean isEnabled() {
            return form.getState() == allowedState;
        }
}

or you can add the link higher in the component hierarchy, don't as an form
child.

On Mon, Apr 19, 2010 at 1:45 PM, Dan Haywood <dkhayw...@gmail.com> wrote:

>  I have a FormComponentPanel (called EntityLink) that holds an image, a
> hyperlink (a BookmarkablePageLink) and a hidden text field holding the
> serializable value of the reference.
>
> Initially I want the form is in read-only mode and so I have disabled all
> of its form components.  However, I'd like the link to be enabled.
>
> Looking at the source code, Wicket calls isLinkEnabled() to determine how
> to render the link; this in turn calls isEnabledInHierarchy().  My problem
> is the latter is (correctly returning false) but I want the former to return
> true.  Both methods are final, however.
>
> I'm obviously tackling this incorrectly - so what would be the Wicket way?
>
> Thanks
> Dan
>
>
> --
> Dan Haywood   consultant, mentor, developer, author   agile, ddd, oo,
> java, .net, sybase   MA, MBCS, CITP, CEng   *mail: *
> d...@haywood-associates.co.uk   *phone: *+44 (0)7961 144286   *book: *Domain
> Driven Design using Naked Objects <http://pragprog.com/titles/dhnako>   *blog:
> *http://danhaywood.com   *linked in: *http://uk.linkedin.com/in/dkhaywood
> *twitter: *http://twitter.com/dkhaywood   *sybase: *
> http://sybtraining.co.uk
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>



-- 
Pedro Henrique Oliveira dos Santos

Reply via email to