You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Kevin Gutch <kg...@protechemail.com> on 2007/03/12 22:45:43 UTC
Re: Migrate from a:href to commandLink
Oh yes. I believe I could do that but it does not really solve the hover
issue. Does it?
Simon Kitching wrote:
> Kevin Gutch wrote:
>> I have a html link styled with CSS (see below).
>>
>> .a#j {display:block; width:105px; height:0; padding-top:115px;
>> overflow:hidden; position:absolute; left:5px; top:47px;
>> background:transparent
>> url(#{facesContext.externalContext.requestContextPath}/images/j.jpg)
>> no-repeat 340px 200px;}
>> * html a#j {height:120px; he\ight:0;}
>> a#j:hover {background-position: 0 0; overflow:visible;}
>>
>> I want to replace the <a/> with an commandLink and maintain the
>> style. However, just switching out the tag breaks the style. I can
>> add the style to inline to the commandLink by adding the style
>> attribute. However, I am not sure how to add the hover style?
>
> You mention "inline style" on the commandLink. Have you considered
> using the "styleClass" attribute to assign a css *class* rather than
> an inline style?
>
--
*Kevin Gutch*
*Protech Products, Inc*.
407.328.5300, ext. 102
407.328.5250 (fax)
Re: Migrate from a:href to commandLink
Posted by Simon Kitching <si...@rhe.co.nz>.
Why not? The h:commandLink tag renders an html <a> tag. It doesn't
actually use the normal <a> behaviour; instead it attaches javascript to
the onclick of the anchor that causes a form submit and suppresses the
normal result of clicking on the link. However because the html tag *is*
an <a>, css should be able to use the hover pseudo-attribute on it.
Am I missing something here?
Kevin Gutch wrote:
> Oh yes. I believe I could do that but it does not really solve the hover
> issue. Does it?
>
>
>
> Simon Kitching wrote:
>> Kevin Gutch wrote:
>>> I have a html link styled with CSS (see below).
>>>
>>> .a#j {display:block; width:105px; height:0; padding-top:115px;
>>> overflow:hidden; position:absolute; left:5px; top:47px;
>>> background:transparent
>>> url(#{facesContext.externalContext.requestContextPath}/images/j.jpg)
>>> no-repeat 340px 200px;}
>>> * html a#j {height:120px; he\ight:0;}
>>> a#j:hover {background-position: 0 0; overflow:visible;}
>>>
>>> I want to replace the <a/> with an commandLink and maintain the
>>> style. However, just switching out the tag breaks the style. I can
>>> add the style to inline to the commandLink by adding the style
>>> attribute. However, I am not sure how to add the hover style?
>>
>> You mention "inline style" on the commandLink. Have you considered
>> using the "styleClass" attribute to assign a css *class* rather than
>> an inline style?
>>
>