You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by keithrbennett <ke...@gmail.com> on 2009/07/17 21:38:19 UTC

Re: Markup for disabled Link - Proposal (add behavior instead of markup)

Pixologe -

I am a relative beginner at Wicket, but FWIW your ideas sound reasonable and
helpful.

I have a link with an image, and would like to display an alternate image if
the link is disabled.  I understand that it should be a span element so that
clicking has no effect.

Can you, Igor, or anyone, explain to me, or point me to resources, that
would show me how to do this?

Thanks,
Keith Bennett



pixologe wrote:
> 
> Thanks for inspiration, igor. :)
> Well, it would not help the mentioned problem of not being able to change
> the style of an element depending on its child elements. However, as I
> thought about this, I realized that I could do some global changes in the
> weird templates and stylesheets I got, so CSS could differentiate by
> a.myClass and span.myClass. As these changes would cause a lot of
> side-effects in the files, I think I'll better stick with the
> AttributeAppender I've currently got in there.
> 
> Still I think that having markup in Java strings as well as using [em] to
> mark disabledness are not the best ideas - but let's not discuss this any
> longer :)
> 
> Cheers.
> 

-- 
View this message in context: http://www.nabble.com/Markup-for-disabled-Link---Proposal-%28add-behavior-instead-of-markup%29-tp19570584p24540451.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Markup for disabled Link - Proposal (add behavior instead of markup)

Posted by keithrbennett <ke...@gmail.com>.
I got this working with the following code in the constructor of my Link
subclass:

http://gist.github.com/149344

...and removing the text from the HTML element so it wouldn't display
alongside the image.

I don't know if this is the best way, though.

It would probably make sense for me to refactor this into a class or
something, but it would be even nicer if it were built into Wicket, assuming
it's a common use case to display an image when disabled.

- Keith




keithrbennett wrote:
> 
> Pixologe -
> 
> I am a relative beginner at Wicket, but FWIW your ideas sound reasonable
> and helpful.
> 
> I have a link with an image, and would like to display an alternate image
> if the link is disabled.  I understand that it should be a span element so
> that clicking has no effect.
> 
> Can you, Igor, or anyone, explain to me, or point me to resources, that
> would show me how to do this?
> 
> Thanks,
> Keith Bennett
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Markup-for-disabled-Link---Proposal-%28add-behavior-instead-of-markup%29-tp19570584p24543114.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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