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

2009-07-17 Thread keithrbennett

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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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

2009-07-17 Thread keithrbennett

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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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

2008-09-19 Thread pixologe

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.



> Example: a Link with an arrow image (CSS background) - quite common. It is
> not (at least as easy as it should be) possible to have another image for
> a disabled link with this behavior, since there is nothing like an
> if-element-has-child-element-selector in CSS. 
> 


igor.vaynberg wrote:
> 
> setdefaultbeforedisabledlink(" ") will do what you want
> 
> -igor
> 
> On Fri, Sep 19, 2008 at 11:27 AM, pixologe <[EMAIL PROTECTED]>
> wrote:
>>
>> setDefault*DisabledLink?
>> I know them and I am using them, as I already wrote.
>>
>> Just considered it would be nice to have setDefaultDisabledLinkBehavior,
>> too. And that I think it would be more obvious to have this applied by
>> default.
>>
>> Was just a proposal, never mind.
>>
>>
>>
>> igor.vaynberg wrote:
>>>
>>> application.getmarkupsettings()
>>>
>>> -igor
>>>
>>> On Fri, Sep 19, 2008 at 11:15 AM, pixologe <[EMAIL PROTECTED]>
>>> wrote:

 would you mind giving a hint?


 igor.vaynberg wrote:
>
> On Fri, Sep 19, 2008 at 9:24 AM, pixologe <[EMAIL PROTECTED]>
> wrote:
>>
>> Of course, you are right. Sorry, what I wrote was not completely
>> clear.
>> It can make sense to change the markup in order to disable a link.
>> It definitely makes sense to exchange [a] with [span], yes.
>>
>> I was merely targeting at the appearance part: I think that adding
>> markup
>> between this [span] element and its content is not very useful in
>> most
>> cases. Of course, the functionality may come in handy if there is
>> need,
>> I
>> just think it should not necessarily be done by default.
>> And if there is a global setting for this, a global setting for a
>> defaultDisabledLinkBehavior would definitely be a good idea, too.
>
> there is a global setting
>
> -igor
>
>
>>
>> I would guess that most people are calling
>> setDefaultAfterDisabledLink("")
>> and setDefaultBeforeDisabledLink("") to turn this behavior off, or
>> use
>> CSS
>> in order to have their text non-italic again, and add an
>> AttributeModifier
>> instead. IMO it is just more obvious and more logical from the HTML
>> template
>> and semantic point of view, even more when we are talking about [em].
>>
>> However, if you do not share my opinion, I can stick to overriding
>> the
>> default behavior, of course :)
>>
>>
>>
>> igor.vaynberg wrote:
>>>
>>> disabled is more then just about the appearance, if something is
>>> disabled the user should not be able to interact with it. for
>>> example,
>>> security strategy can disable links the user does not have access
>>> to.
>>> just adding class="disabled" leaves the link clickable.
>>>
>>> -igor
>>>
>>> On Fri, Sep 19, 2008 at 4:21 AM, pixologe <[EMAIL PROTECTED]>
>>> wrote:

 Dear Wicket devs,

 I propose that by default a disabled link should rather (or also)
 be
 marked
 using a behavior, instead of adding markup before and after.

 A word in advance: I know that I can implement my own version of
 Link
 which
 adds behavior in case of being disabled, and I know how to do it -
 this
 is
 not a cry for help, just a proposal, how I think the Link component
 should
 behave to fit most common use cases. The current way simple does
 not
 feel
 right.

 Why do I think so? When creating a template, most people tend to
 display
 a
 disabled status of an element by appending a css class to its tag,
 you
 can
 see class="disabled" very often, making colors gray or applying
 transparency.
 IMHO something like this should not be done by changing the DOM
 hierarchy
 of
 the element.

 Example: a Link with an arrow image (CSS background) - quite
 common.
 It
 is
 not (at least as easy as it should be) possible to have another
 image
 for
 a
 disabled link with this behavior, since there is nothing like an
 if-element-has-child-e

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

2008-09-19 Thread Igor Vaynberg
setdefaultbeforedisabledlink("") will do what you want

-igor

On Fri, Sep 19, 2008 at 11:27 AM, pixologe <[EMAIL PROTECTED]> wrote:
>
> setDefault*DisabledLink?
> I know them and I am using them, as I already wrote.
>
> Just considered it would be nice to have setDefaultDisabledLinkBehavior,
> too. And that I think it would be more obvious to have this applied by
> default.
>
> Was just a proposal, never mind.
>
>
>
> igor.vaynberg wrote:
>>
>> application.getmarkupsettings()
>>
>> -igor
>>
>> On Fri, Sep 19, 2008 at 11:15 AM, pixologe <[EMAIL PROTECTED]>
>> wrote:
>>>
>>> would you mind giving a hint?
>>>
>>>
>>> igor.vaynberg wrote:

 On Fri, Sep 19, 2008 at 9:24 AM, pixologe <[EMAIL PROTECTED]>
 wrote:
>
> Of course, you are right. Sorry, what I wrote was not completely clear.
> It can make sense to change the markup in order to disable a link.
> It definitely makes sense to exchange [a] with [span], yes.
>
> I was merely targeting at the appearance part: I think that adding
> markup
> between this [span] element and its content is not very useful in most
> cases. Of course, the functionality may come in handy if there is need,
> I
> just think it should not necessarily be done by default.
> And if there is a global setting for this, a global setting for a
> defaultDisabledLinkBehavior would definitely be a good idea, too.

 there is a global setting

 -igor


>
> I would guess that most people are calling
> setDefaultAfterDisabledLink("")
> and setDefaultBeforeDisabledLink("") to turn this behavior off, or use
> CSS
> in order to have their text non-italic again, and add an
> AttributeModifier
> instead. IMO it is just more obvious and more logical from the HTML
> template
> and semantic point of view, even more when we are talking about [em].
>
> However, if you do not share my opinion, I can stick to overriding the
> default behavior, of course :)
>
>
>
> igor.vaynberg wrote:
>>
>> disabled is more then just about the appearance, if something is
>> disabled the user should not be able to interact with it. for example,
>> security strategy can disable links the user does not have access to.
>> just adding class="disabled" leaves the link clickable.
>>
>> -igor
>>
>> On Fri, Sep 19, 2008 at 4:21 AM, pixologe <[EMAIL PROTECTED]>
>> wrote:
>>>
>>> Dear Wicket devs,
>>>
>>> I propose that by default a disabled link should rather (or also) be
>>> marked
>>> using a behavior, instead of adding markup before and after.
>>>
>>> A word in advance: I know that I can implement my own version of Link
>>> which
>>> adds behavior in case of being disabled, and I know how to do it -
>>> this
>>> is
>>> not a cry for help, just a proposal, how I think the Link component
>>> should
>>> behave to fit most common use cases. The current way simple does not
>>> feel
>>> right.
>>>
>>> Why do I think so? When creating a template, most people tend to
>>> display
>>> a
>>> disabled status of an element by appending a css class to its tag,
>>> you
>>> can
>>> see class="disabled" very often, making colors gray or applying
>>> transparency.
>>> IMHO something like this should not be done by changing the DOM
>>> hierarchy
>>> of
>>> the element.
>>>
>>> Example: a Link with an arrow image (CSS background) - quite common.
>>> It
>>> is
>>> not (at least as easy as it should be) possible to have another image
>>> for
>>> a
>>> disabled link with this behavior, since there is nothing like an
>>> if-element-has-child-element-selector in CSS.
>>>
>>> Besides (I know it is configurable, but...) : I am not sure why one
>>> would
>>> want to [em]phasize something that's disabled ;-)
>>>
>>> I would love to see a defaultDisabledLinkBehavior property in future
>>> versions, this would make it a lot easier to style disabled links...
>>>
>>> Cheers + best regards :)
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Markup-for-disabled-Link---Proposal-%28add-behavior-instead-of-markup%29-tp19570584p19570584.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/Markup-for-disabled-Link---Proposal-%28a

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

2008-09-19 Thread pixologe

setDefault*DisabledLink?
I know them and I am using them, as I already wrote.

Just considered it would be nice to have setDefaultDisabledLinkBehavior,
too. And that I think it would be more obvious to have this applied by
default.

Was just a proposal, never mind.



igor.vaynberg wrote:
> 
> application.getmarkupsettings()
> 
> -igor
> 
> On Fri, Sep 19, 2008 at 11:15 AM, pixologe <[EMAIL PROTECTED]>
> wrote:
>>
>> would you mind giving a hint?
>>
>>
>> igor.vaynberg wrote:
>>>
>>> On Fri, Sep 19, 2008 at 9:24 AM, pixologe <[EMAIL PROTECTED]>
>>> wrote:

 Of course, you are right. Sorry, what I wrote was not completely clear.
 It can make sense to change the markup in order to disable a link.
 It definitely makes sense to exchange [a] with [span], yes.

 I was merely targeting at the appearance part: I think that adding
 markup
 between this [span] element and its content is not very useful in most
 cases. Of course, the functionality may come in handy if there is need,
 I
 just think it should not necessarily be done by default.
 And if there is a global setting for this, a global setting for a
 defaultDisabledLinkBehavior would definitely be a good idea, too.
>>>
>>> there is a global setting
>>>
>>> -igor
>>>
>>>

 I would guess that most people are calling
 setDefaultAfterDisabledLink("")
 and setDefaultBeforeDisabledLink("") to turn this behavior off, or use
 CSS
 in order to have their text non-italic again, and add an
 AttributeModifier
 instead. IMO it is just more obvious and more logical from the HTML
 template
 and semantic point of view, even more when we are talking about [em].

 However, if you do not share my opinion, I can stick to overriding the
 default behavior, of course :)



 igor.vaynberg wrote:
>
> disabled is more then just about the appearance, if something is
> disabled the user should not be able to interact with it. for example,
> security strategy can disable links the user does not have access to.
> just adding class="disabled" leaves the link clickable.
>
> -igor
>
> On Fri, Sep 19, 2008 at 4:21 AM, pixologe <[EMAIL PROTECTED]>
> wrote:
>>
>> Dear Wicket devs,
>>
>> I propose that by default a disabled link should rather (or also) be
>> marked
>> using a behavior, instead of adding markup before and after.
>>
>> A word in advance: I know that I can implement my own version of Link
>> which
>> adds behavior in case of being disabled, and I know how to do it -
>> this
>> is
>> not a cry for help, just a proposal, how I think the Link component
>> should
>> behave to fit most common use cases. The current way simple does not
>> feel
>> right.
>>
>> Why do I think so? When creating a template, most people tend to
>> display
>> a
>> disabled status of an element by appending a css class to its tag,
>> you
>> can
>> see class="disabled" very often, making colors gray or applying
>> transparency.
>> IMHO something like this should not be done by changing the DOM
>> hierarchy
>> of
>> the element.
>>
>> Example: a Link with an arrow image (CSS background) - quite common.
>> It
>> is
>> not (at least as easy as it should be) possible to have another image
>> for
>> a
>> disabled link with this behavior, since there is nothing like an
>> if-element-has-child-element-selector in CSS.
>>
>> Besides (I know it is configurable, but...) : I am not sure why one
>> would
>> want to [em]phasize something that's disabled ;-)
>>
>> I would love to see a defaultDisabledLinkBehavior property in future
>> versions, this would make it a lot easier to style disabled links...
>>
>> Cheers + best regards :)
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Markup-for-disabled-Link---Proposal-%28add-behavior-instead-of-markup%29-tp19570584p19570584.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

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


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional com

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

2008-09-19 Thread Igor Vaynberg
application.getmarkupsettings()

-igor

On Fri, Sep 19, 2008 at 11:15 AM, pixologe <[EMAIL PROTECTED]> wrote:
>
> would you mind giving a hint?
>
>
> igor.vaynberg wrote:
>>
>> On Fri, Sep 19, 2008 at 9:24 AM, pixologe <[EMAIL PROTECTED]> wrote:
>>>
>>> Of course, you are right. Sorry, what I wrote was not completely clear.
>>> It can make sense to change the markup in order to disable a link.
>>> It definitely makes sense to exchange [a] with [span], yes.
>>>
>>> I was merely targeting at the appearance part: I think that adding markup
>>> between this [span] element and its content is not very useful in most
>>> cases. Of course, the functionality may come in handy if there is need, I
>>> just think it should not necessarily be done by default.
>>> And if there is a global setting for this, a global setting for a
>>> defaultDisabledLinkBehavior would definitely be a good idea, too.
>>
>> there is a global setting
>>
>> -igor
>>
>>
>>>
>>> I would guess that most people are calling
>>> setDefaultAfterDisabledLink("")
>>> and setDefaultBeforeDisabledLink("") to turn this behavior off, or use
>>> CSS
>>> in order to have their text non-italic again, and add an
>>> AttributeModifier
>>> instead. IMO it is just more obvious and more logical from the HTML
>>> template
>>> and semantic point of view, even more when we are talking about [em].
>>>
>>> However, if you do not share my opinion, I can stick to overriding the
>>> default behavior, of course :)
>>>
>>>
>>>
>>> igor.vaynberg wrote:

 disabled is more then just about the appearance, if something is
 disabled the user should not be able to interact with it. for example,
 security strategy can disable links the user does not have access to.
 just adding class="disabled" leaves the link clickable.

 -igor

 On Fri, Sep 19, 2008 at 4:21 AM, pixologe <[EMAIL PROTECTED]>
 wrote:
>
> Dear Wicket devs,
>
> I propose that by default a disabled link should rather (or also) be
> marked
> using a behavior, instead of adding markup before and after.
>
> A word in advance: I know that I can implement my own version of Link
> which
> adds behavior in case of being disabled, and I know how to do it - this
> is
> not a cry for help, just a proposal, how I think the Link component
> should
> behave to fit most common use cases. The current way simple does not
> feel
> right.
>
> Why do I think so? When creating a template, most people tend to
> display
> a
> disabled status of an element by appending a css class to its tag, you
> can
> see class="disabled" very often, making colors gray or applying
> transparency.
> IMHO something like this should not be done by changing the DOM
> hierarchy
> of
> the element.
>
> Example: a Link with an arrow image (CSS background) - quite common. It
> is
> not (at least as easy as it should be) possible to have another image
> for
> a
> disabled link with this behavior, since there is nothing like an
> if-element-has-child-element-selector in CSS.
>
> Besides (I know it is configurable, but...) : I am not sure why one
> would
> want to [em]phasize something that's disabled ;-)
>
> I would love to see a defaultDisabledLinkBehavior property in future
> versions, this would make it a lot easier to style disabled links...
>
> Cheers + best regards :)
>
> --
> View this message in context:
> http://www.nabble.com/Markup-for-disabled-Link---Proposal-%28add-behavior-instead-of-markup%29-tp19570584p19570584.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Markup-for-disabled-Link---Proposal-%28add-behavior-instead-of-markup%29-tp19570584p19575441.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Markup-for-disabled-Link---Proposal-%28add-behavior-instead-of-markup%29-tp19570584p19577220.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---

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

2008-09-19 Thread pixologe

would you mind giving a hint?


igor.vaynberg wrote:
> 
> On Fri, Sep 19, 2008 at 9:24 AM, pixologe <[EMAIL PROTECTED]> wrote:
>>
>> Of course, you are right. Sorry, what I wrote was not completely clear.
>> It can make sense to change the markup in order to disable a link.
>> It definitely makes sense to exchange [a] with [span], yes.
>>
>> I was merely targeting at the appearance part: I think that adding markup
>> between this [span] element and its content is not very useful in most
>> cases. Of course, the functionality may come in handy if there is need, I
>> just think it should not necessarily be done by default.
>> And if there is a global setting for this, a global setting for a
>> defaultDisabledLinkBehavior would definitely be a good idea, too.
> 
> there is a global setting
> 
> -igor
> 
> 
>>
>> I would guess that most people are calling
>> setDefaultAfterDisabledLink("")
>> and setDefaultBeforeDisabledLink("") to turn this behavior off, or use
>> CSS
>> in order to have their text non-italic again, and add an
>> AttributeModifier
>> instead. IMO it is just more obvious and more logical from the HTML
>> template
>> and semantic point of view, even more when we are talking about [em].
>>
>> However, if you do not share my opinion, I can stick to overriding the
>> default behavior, of course :)
>>
>>
>>
>> igor.vaynberg wrote:
>>>
>>> disabled is more then just about the appearance, if something is
>>> disabled the user should not be able to interact with it. for example,
>>> security strategy can disable links the user does not have access to.
>>> just adding class="disabled" leaves the link clickable.
>>>
>>> -igor
>>>
>>> On Fri, Sep 19, 2008 at 4:21 AM, pixologe <[EMAIL PROTECTED]>
>>> wrote:

 Dear Wicket devs,

 I propose that by default a disabled link should rather (or also) be
 marked
 using a behavior, instead of adding markup before and after.

 A word in advance: I know that I can implement my own version of Link
 which
 adds behavior in case of being disabled, and I know how to do it - this
 is
 not a cry for help, just a proposal, how I think the Link component
 should
 behave to fit most common use cases. The current way simple does not
 feel
 right.

 Why do I think so? When creating a template, most people tend to
 display
 a
 disabled status of an element by appending a css class to its tag, you
 can
 see class="disabled" very often, making colors gray or applying
 transparency.
 IMHO something like this should not be done by changing the DOM
 hierarchy
 of
 the element.

 Example: a Link with an arrow image (CSS background) - quite common. It
 is
 not (at least as easy as it should be) possible to have another image
 for
 a
 disabled link with this behavior, since there is nothing like an
 if-element-has-child-element-selector in CSS.

 Besides (I know it is configurable, but...) : I am not sure why one
 would
 want to [em]phasize something that's disabled ;-)

 I would love to see a defaultDisabledLinkBehavior property in future
 versions, this would make it a lot easier to style disabled links...

 Cheers + best regards :)

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


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Markup-for-disabled-Link---Proposal-%28add-behavior-instead-of-markup%29-tp19570584p19575441.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

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


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2008-09-19 Thread Igor Vaynberg
On Fri, Sep 19, 2008 at 9:24 AM, pixologe <[EMAIL PROTECTED]> wrote:
>
> Of course, you are right. Sorry, what I wrote was not completely clear.
> It can make sense to change the markup in order to disable a link.
> It definitely makes sense to exchange [a] with [span], yes.
>
> I was merely targeting at the appearance part: I think that adding markup
> between this [span] element and its content is not very useful in most
> cases. Of course, the functionality may come in handy if there is need, I
> just think it should not necessarily be done by default.
> And if there is a global setting for this, a global setting for a
> defaultDisabledLinkBehavior would definitely be a good idea, too.

there is a global setting

-igor


>
> I would guess that most people are calling setDefaultAfterDisabledLink("")
> and setDefaultBeforeDisabledLink("") to turn this behavior off, or use CSS
> in order to have their text non-italic again, and add an AttributeModifier
> instead. IMO it is just more obvious and more logical from the HTML template
> and semantic point of view, even more when we are talking about [em].
>
> However, if you do not share my opinion, I can stick to overriding the
> default behavior, of course :)
>
>
>
> igor.vaynberg wrote:
>>
>> disabled is more then just about the appearance, if something is
>> disabled the user should not be able to interact with it. for example,
>> security strategy can disable links the user does not have access to.
>> just adding class="disabled" leaves the link clickable.
>>
>> -igor
>>
>> On Fri, Sep 19, 2008 at 4:21 AM, pixologe <[EMAIL PROTECTED]> wrote:
>>>
>>> Dear Wicket devs,
>>>
>>> I propose that by default a disabled link should rather (or also) be
>>> marked
>>> using a behavior, instead of adding markup before and after.
>>>
>>> A word in advance: I know that I can implement my own version of Link
>>> which
>>> adds behavior in case of being disabled, and I know how to do it - this
>>> is
>>> not a cry for help, just a proposal, how I think the Link component
>>> should
>>> behave to fit most common use cases. The current way simple does not feel
>>> right.
>>>
>>> Why do I think so? When creating a template, most people tend to display
>>> a
>>> disabled status of an element by appending a css class to its tag, you
>>> can
>>> see class="disabled" very often, making colors gray or applying
>>> transparency.
>>> IMHO something like this should not be done by changing the DOM hierarchy
>>> of
>>> the element.
>>>
>>> Example: a Link with an arrow image (CSS background) - quite common. It
>>> is
>>> not (at least as easy as it should be) possible to have another image for
>>> a
>>> disabled link with this behavior, since there is nothing like an
>>> if-element-has-child-element-selector in CSS.
>>>
>>> Besides (I know it is configurable, but...) : I am not sure why one would
>>> want to [em]phasize something that's disabled ;-)
>>>
>>> I would love to see a defaultDisabledLinkBehavior property in future
>>> versions, this would make it a lot easier to style disabled links...
>>>
>>> Cheers + best regards :)
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Markup-for-disabled-Link---Proposal-%28add-behavior-instead-of-markup%29-tp19570584p19570584.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Markup-for-disabled-Link---Proposal-%28add-behavior-instead-of-markup%29-tp19570584p19575441.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2008-09-19 Thread pixologe

Of course, you are right. Sorry, what I wrote was not completely clear.
It can make sense to change the markup in order to disable a link.
It definitely makes sense to exchange [a] with [span], yes.

I was merely targeting at the appearance part: I think that adding markup
between this [span] element and its content is not very useful in most
cases. Of course, the functionality may come in handy if there is need, I
just think it should not necessarily be done by default.
And if there is a global setting for this, a global setting for a
defaultDisabledLinkBehavior would definitely be a good idea, too.

I would guess that most people are calling setDefaultAfterDisabledLink("")
and setDefaultBeforeDisabledLink("") to turn this behavior off, or use CSS
in order to have their text non-italic again, and add an AttributeModifier
instead. IMO it is just more obvious and more logical from the HTML template
and semantic point of view, even more when we are talking about [em].

However, if you do not share my opinion, I can stick to overriding the
default behavior, of course :)



igor.vaynberg wrote:
> 
> disabled is more then just about the appearance, if something is
> disabled the user should not be able to interact with it. for example,
> security strategy can disable links the user does not have access to.
> just adding class="disabled" leaves the link clickable.
> 
> -igor
> 
> On Fri, Sep 19, 2008 at 4:21 AM, pixologe <[EMAIL PROTECTED]> wrote:
>>
>> Dear Wicket devs,
>>
>> I propose that by default a disabled link should rather (or also) be
>> marked
>> using a behavior, instead of adding markup before and after.
>>
>> A word in advance: I know that I can implement my own version of Link
>> which
>> adds behavior in case of being disabled, and I know how to do it - this
>> is
>> not a cry for help, just a proposal, how I think the Link component
>> should
>> behave to fit most common use cases. The current way simple does not feel
>> right.
>>
>> Why do I think so? When creating a template, most people tend to display
>> a
>> disabled status of an element by appending a css class to its tag, you
>> can
>> see class="disabled" very often, making colors gray or applying
>> transparency.
>> IMHO something like this should not be done by changing the DOM hierarchy
>> of
>> the element.
>>
>> Example: a Link with an arrow image (CSS background) - quite common. It
>> is
>> not (at least as easy as it should be) possible to have another image for
>> a
>> disabled link with this behavior, since there is nothing like an
>> if-element-has-child-element-selector in CSS.
>>
>> Besides (I know it is configurable, but...) : I am not sure why one would
>> want to [em]phasize something that's disabled ;-)
>>
>> I would love to see a defaultDisabledLinkBehavior property in future
>> versions, this would make it a lot easier to style disabled links...
>>
>> Cheers + best regards :)
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Markup-for-disabled-Link---Proposal-%28add-behavior-instead-of-markup%29-tp19570584p19570584.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

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


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2008-09-19 Thread Igor Vaynberg
disabled is more then just about the appearance, if something is
disabled the user should not be able to interact with it. for example,
security strategy can disable links the user does not have access to.
just adding class="disabled" leaves the link clickable.

-igor

On Fri, Sep 19, 2008 at 4:21 AM, pixologe <[EMAIL PROTECTED]> wrote:
>
> Dear Wicket devs,
>
> I propose that by default a disabled link should rather (or also) be marked
> using a behavior, instead of adding markup before and after.
>
> A word in advance: I know that I can implement my own version of Link which
> adds behavior in case of being disabled, and I know how to do it - this is
> not a cry for help, just a proposal, how I think the Link component should
> behave to fit most common use cases. The current way simple does not feel
> right.
>
> Why do I think so? When creating a template, most people tend to display a
> disabled status of an element by appending a css class to its tag, you can
> see class="disabled" very often, making colors gray or applying
> transparency.
> IMHO something like this should not be done by changing the DOM hierarchy of
> the element.
>
> Example: a Link with an arrow image (CSS background) - quite common. It is
> not (at least as easy as it should be) possible to have another image for a
> disabled link with this behavior, since there is nothing like an
> if-element-has-child-element-selector in CSS.
>
> Besides (I know it is configurable, but...) : I am not sure why one would
> want to [em]phasize something that's disabled ;-)
>
> I would love to see a defaultDisabledLinkBehavior property in future
> versions, this would make it a lot easier to style disabled links...
>
> Cheers + best regards :)
>
> --
> View this message in context: 
> http://www.nabble.com/Markup-for-disabled-Link---Proposal-%28add-behavior-instead-of-markup%29-tp19570584p19570584.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2008-09-19 Thread pixologe

Actually that is what I do. That's what I meant when I said "implement own
version"... Basically it extends AjaxFallbackLink overriding onBeforeRender
to add a Modifier dependent on the enabled property.

Just wanted to point out that this is the behavior I would have expected by
default, instead of having the page hierarchy modified and the link
displayed in italics...



Nino.Martinez wrote:
> 
> Why not just use an attribute modifier?
> 
> pixologe wrote:
>> Dear Wicket devs,
>>
>> I propose that by default a disabled link should rather (or also) be
>> marked
>> using a behavior, instead of adding markup before and after.
>>
>> A word in advance: I know that I can implement my own version of Link
>> which
>> adds behavior in case of being disabled, and I know how to do it - this
>> is
>> not a cry for help, just a proposal, how I think the Link component
>> should
>> behave to fit most common use cases. The current way simple does not feel
>> right.
>>
>> Why do I think so? When creating a template, most people tend to display
>> a
>> disabled status of an element by appending a css class to its tag, you
>> can
>> see class="disabled" very often, making colors gray or applying
>> transparency. 
>> IMHO something like this should not be done by changing the DOM hierarchy
>> of
>> the element.
>>
>> Example: a Link with an arrow image (CSS background) - quite common. It
>> is
>> not (at least as easy as it should be) possible to have another image for
>> a
>> disabled link with this behavior, since there is nothing like an
>> if-element-has-child-element-selector in CSS.
>>
>> Besides (I know it is configurable, but...) : I am not sure why one would
>> want to [em]phasize something that's disabled ;-)
>>
>> I would love to see a defaultDisabledLinkBehavior property in future
>> versions, this would make it a lot easier to style disabled links...
>>
>> Cheers + best regards :)
>>
>>   
> 
> -- 
> -Wicket for love
> 
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

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


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2008-09-19 Thread Nino Saturnino Martinez Vazquez Wael

Why not just use an attribute modifier?

pixologe wrote:

Dear Wicket devs,

I propose that by default a disabled link should rather (or also) be marked
using a behavior, instead of adding markup before and after.

A word in advance: I know that I can implement my own version of Link which
adds behavior in case of being disabled, and I know how to do it - this is
not a cry for help, just a proposal, how I think the Link component should
behave to fit most common use cases. The current way simple does not feel
right.

Why do I think so? When creating a template, most people tend to display a
disabled status of an element by appending a css class to its tag, you can
see class="disabled" very often, making colors gray or applying
transparency. 
IMHO something like this should not be done by changing the DOM hierarchy of

the element.

Example: a Link with an arrow image (CSS background) - quite common. It is
not (at least as easy as it should be) possible to have another image for a
disabled link with this behavior, since there is nothing like an
if-element-has-child-element-selector in CSS.

Besides (I know it is configurable, but...) : I am not sure why one would
want to [em]phasize something that's disabled ;-)

I would love to see a defaultDisabledLinkBehavior property in future
versions, this would make it a lot easier to style disabled links...

Cheers + best regards :)

  


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]