myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Robinson" <andrew.rw.robin...@gmail.com>
Subject Re: [Trinidad] Programmatically get a style from the skin
Date Thu, 23 Aug 2007 15:32:24 GMT
Created an enhancement request

https://issues.apache.org/jira/browse/TRINIDAD-645

-Andrew

On 8/21/07, Jeanne Waldman <jeanne.waldman@oracle.com> wrote:
> I've heard this request from a few people. You should add a JIRA issue
> if it isn't already there.
>
> Currently, no, there is no way to get this information. There is a
> workaround that I've used.
>
> It is to use a skin property. Then you can call skin.getProperty and
> pass in the key.
> It's a hack.
>
> So... you'd do this:
>
> In your CSS file you would define your selector. Add your color
> property. And then make up some
> skin property (starts with -tr- and NOT -tr-inhibit or -tr-rule-ref).
>
> af|panelBox::medium af|panelBox::body {
>   color: red;
>   -tr-my-color-property: red;
> }
>
> The -tr-my-color-property gets registered with the skin automatically.
>
> You retrieve it by calling skin.getProperty("af|panelBox::medium af|panelBox::body-tr-my-color-property")
>
> - Jeanne
>
>
>
>
>
>
> Andrew Robinson wrote:
> > Is there a way to get a value from the skin programmatically?
> >
> > For example, I have to add a color to an attribute of a JSF component.
> > I would like to use a value from the current skin. Specifically the
> > background color from:
> > af|panelBox::medium af|panelBox::body
> >
> > Is there any way to accomplish this?
> >
> >
>

Mime
View raw message