But this requires hard coding of the path to spacer.gif.  What we are trying
to do is implement skins so that the user can change the look and feel of
the web page and may decide to choose bigger buttons which may require a
change to spacer.gif(?).  Not really sure.  will experiment with this and
see what happens.

thanks for the help.

L


Cooper, Stephen-2 wrote:
> 
> Here's an idea:
>  Define a CSS class, say 'delete'
> .delete {
>   background-image: url('path-to-image');
>   background-repeat: none;
>   background-position: center;
> }
> 
> Next, 
> Make your command link have the class of 'delete', and put a 1x1
> transparent gif image, sized to the correct size, inside the commandLink
> e.g. <t:commandLink class='delete'> spacer.gif </t:commandLink>
> 
> Now, depending on which CSS you include, or if the CSS is actually a
> JSP, you can include different images for the delete image.  E.g. a
> trash can or an X.
> 
> Good luck!
> Coop
> (p.s. I made the JSF stuff up on the fly, so the syntax may be wrong.
> The CSS I took from my existing JSP based application)
> 
> -----Original Message-----
> From: Lisa [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, February 08, 2007 11:21 PM
> To: [email protected]
> Subject: Re: <t:commandLink> and image of button - how not to hard code
> 
> 
> anyone have any ideas on this one?  How can an image be configured as a
> resource in one location and referred to by <t:commandLink throughout
> the
> application so that it is hardcoded inonly one place.
> 
> Is there any way to specify the img file location in a CSS and refer to
> it
> in the <t:commandLink?
> 
> thanks
> 
> L
> 
> 
> 
> Lisa wrote:
>> 
>> I have a commandLink below that has a reference to a hard coded path
> to
>> button image.  Is there a way to simply specify a resource, where that
>> resource has the hard coded path to the button?
>> 
>> If so, where are resources like this typically configured?
>> 
>> Is there a better way to write the <t:commandLink> below so that the 3
>> hard coded paths are gone?
>> 
>> thanks
>> 
>> ---
>>                                 <t:commandLink
>>                                     actionListener="#{myBean.addData}"
>>                                     id="btnAdd"
>>                                    
>> onmouseover="BtnAddImg.src='../../images/AddButtonBlue.gif'; return
> true;"
>>                                    
>> onmouseout="BtnAddImg.src='../../images/AddButtonSilver.gif'; return
>> true;"
>>                                 >
>>
> ../../images/Pt-Add-Button-Silver.gif 
>>                                 </t:commandLink>
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/%3Ct%3AcommandLink%3E-and-image-of-button---how-no
> t-to-hard-code-tf3157766.html#a8881008
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/%3Ct%3AcommandLink%3E-and-image-of-button---how-not-to-hard-code-tf3157766.html#a8939041
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to