*<t:if test="xyz">

2010/7/13 Pablo dos Reis <pablodosr...@gmail.com>

> Hi Jim,
>
> You can give an id to body and then use JavaScript.
>
>
> <script>
>    <t:if text="xyz">
>
>          $('body').addClassName('myClass');
>
>         <p:else>
>                         $('body').addClassName('otherClass');
>           </ p:else>
>    </t:if>
> </script>
>
> But I think the Michael's solution very good too.
>
>
>
> 2010/7/13 Michael Gentry <mgen...@masslight.net>
>
> Hi Jim,
>>
>> I've used class="${xyzClass}" before in the past.  Then implemented
>> getXyzClass() in my .java.  You said it was important to not be in the
>> Java for you and had to be in the TML?  Why is it that important when
>> both would require a WAR redeploy in a real production environment?
>>
>> mrg
>>
>>
>> On Tue, Jul 13, 2010 at 11:41 AM, Jim O'Callaghan
>> <j...@peritussolutions.com> wrote:
>> > I've run in to a situation where the CSS class used for the body of my
>> > layout.tml varies depending on certain conditions.  I've tried using
>> > variously:
>> >
>> >
>> >
>> > <body t:class=<t:if test="xyzTest" negate="true">'xyzClass'</t:if>>
>> >
>> >
>> >
>> > Or:
>> >
>> >
>> >
>> > <t:if test=" xyzTest ">
>> >
>> >                                <body class="'xyzClass'">
>> >
>> >                <p:else>
>> >
>> >                                <body>
>> >
>> >                </ p:else>
>> >
>> >    </t:if>
>> >
>> >
>> >
>> > . and several other permutations without success - I am getting
>> variations
>> > on parse errors with the general theme that class parameters cannot
>> contain
>> > quotes, or that body tag must be accompanied by closing body tag etc.
>> >
>> >
>> >
>> > Can anyone suggest a working approach to this simple use case?  It's
>> > important to be able to have the CSS class explicitly in the tml, and
>> not
>> > buried in a java property.
>> >
>> >
>> >
>> > Thanks,
>> >
>> > Jim.
>> >
>> >
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
>
> --
> Pablo Henrique dos Reis
>
>


-- 
Pablo Henrique dos Reis

Reply via email to