I forgot to mention: the link is created by other people's code.  I can't
change the template: I can't put wicket:id in the <img> tag.

>new image(...) {
> oncomponenttag(tag) {
>     if (link.isenabled()==false) { tag.put("class","foo"); }

So how would this work?

new Image("there-is-not-wicket-id-to-use"...

Anyway, I was hoping I can do:

link.add(new AbstractBehavior() {

      onComponentTag(Component c, Component tag) {
            use 'c' or 'tag' to get <img>
            put attr into <img>
      }
);

On Sun, Mar 30, 2008 at 11:31 AM, Igor Vaynberg <[EMAIL PROTECTED]>
wrote:

> new image(...) {
>  oncomponenttag(tag) {
>      if (link.isenabled()==false) { tag.put("class","foo"); }
>  }
> }
>
> -igor
>
>
> On Sun, Mar 30, 2008 at 11:27 AM, Matthew Young <[EMAIL PROTECTED]> wrote:
> > I have a link like this:
> >
> >  <a wicket:id="link"><img src="face.png"/></a>
> >
> >  When link.isEnable() == false, I need to add style attribute to the
> <img>
> >  tag.  Is it possible to do this without turning the <img> into a child
> >  component of the link?
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to