You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Saldy Mathew <sm...@webifyservices.com> on 2003/07/23 14:18:52 UTC
Tapestry help needed
Hi,
Based on certain condition i need to apply certain class to my div tag.
StyleB is not getting applied.
Could any html experts suggest if i am doing it correctly
Here's how i am doing it
within the head section
<style>
.StyleA{
}
.StyleB{
padding: 6px;
border: 1px solid rgb(102,91,86);
}
</style>
<!-- START OF OUTER DIV.prism_table_contents -->
<div class="ognl:(visit.selectedLSHLevel.equals('network') ? 'StyleA' : 'StyleB')">
Some html contents here
</div>
<!-- END OF OUTER DIV.prism_table_contents -->
Re: Tapestry help needed
Posted by Harish Krishnaswamy <hk...@comcast.net>.
I believe OGNL expressions are evaluated only on Tapestry template tags
(the ones with the jwcid attribute). Anything else is treated as text.
So like mentioned in another post you will have to use the Any
component to accomplish this.
-Harish
Saldy Mathew wrote:
>Hi,
>
>Based on certain condition i need to apply certain class to my div tag.
>
>StyleB is not getting applied.
>
>Could any html experts suggest if i am doing it correctly
>
>Here's how i am doing it
>
>within the head section
><style>
>.StyleA{
>}
>.StyleB{
>padding: 6px;
>border: 1px solid rgb(102,91,86);
>}
></style>
>
>
><!-- START OF OUTER DIV.prism_table_contents -->
>
><div class="ognl:(visit.selectedLSHLevel.equals('network') ? 'StyleA' : 'StyleB')">
>
>Some html contents here
>
></div>
><!-- END OF OUTER DIV.prism_table_contents -->
>
>
RE: Tapestry help needed
Posted by Adam Greene <ag...@romulin.com>.
Your welcome. Yeah, I forgot about the element="div" part.
-----Original Message-----
From: Saldy Mathew [mailto:smathew@webifyservices.com]
Sent: Wednesday, July 23, 2003 10:31 AM
To: Adam Greene; Tapestry users
Subject: Re: Tapestry help needed
Hi Adam
Thanks,your solution has helped me.I had to add the element attribute in
this manner
<div jwcid="@Any" element="div"
class="ognl:(visit.selectedLSHLevel.equals('network') ?
'StyleA' : 'StyleB')">
As per the document the element attribute is not required.In the absence of
the element attribute i received the following error
"Required parameter element of component e_performance/$Any is not bound."
Saldy
----- Original Message -----
From: "Adam Greene" <ag...@romulin.com>
To: "Tapestry users" <ta...@jakarta.apache.org>; "Saldy Mathew"
<sm...@webifyservices.com>
Sent: Wednesday, July 23, 2003 6:44 PM
Subject: RE: Tapestry help needed
> In a case like this one, I suggest the @Any tag, so you would write it as:
>
> <div jwcid="@Any" class="ognl:(visit.selectedLSHLevel.equals('network') ?
> 'StyleA' : 'StyleB')">
>
> -----Original Message-----
> From: Saldy Mathew [mailto:smathew@webifyservices.com]
> Sent: Wednesday, July 23, 2003 9:19 AM
> To: tapestry-user@jakarta.apache.org
> Subject: Tapestry help needed
>
>
> Hi,
>
> Based on certain condition i need to apply certain class to my div tag.
>
> StyleB is not getting applied.
>
> Could any html experts suggest if i am doing it correctly
>
> Here's how i am doing it
>
> within the head section
> <style>
> ..StyleA{
> }
> ..StyleB{
> padding: 6px;
> border: 1px solid rgb(102,91,86);
> }
> </style>
>
>
> <!-- START OF OUTER DIV.prism_table_contents -->
>
> <div class="ognl:(visit.selectedLSHLevel.equals('network') ? 'StyleA' :
> 'StyleB')">
>
> Some html contents here
>
> </div>
> <!-- END OF OUTER DIV.prism_table_contents -->
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry help needed
Posted by Saldy Mathew <sm...@webifyservices.com>.
Hi Adam
Thanks,your solution has helped me.I had to add the element attribute in
this manner
<div jwcid="@Any" element="div"
class="ognl:(visit.selectedLSHLevel.equals('network') ?
'StyleA' : 'StyleB')">
As per the document the element attribute is not required.In the absence of
the element attribute i received the following error
"Required parameter element of component e_performance/$Any is not bound."
Saldy
----- Original Message -----
From: "Adam Greene" <ag...@romulin.com>
To: "Tapestry users" <ta...@jakarta.apache.org>; "Saldy Mathew"
<sm...@webifyservices.com>
Sent: Wednesday, July 23, 2003 6:44 PM
Subject: RE: Tapestry help needed
> In a case like this one, I suggest the @Any tag, so you would write it as:
>
> <div jwcid="@Any" class="ognl:(visit.selectedLSHLevel.equals('network') ?
> 'StyleA' : 'StyleB')">
>
> -----Original Message-----
> From: Saldy Mathew [mailto:smathew@webifyservices.com]
> Sent: Wednesday, July 23, 2003 9:19 AM
> To: tapestry-user@jakarta.apache.org
> Subject: Tapestry help needed
>
>
> Hi,
>
> Based on certain condition i need to apply certain class to my div tag.
>
> StyleB is not getting applied.
>
> Could any html experts suggest if i am doing it correctly
>
> Here's how i am doing it
>
> within the head section
> <style>
> ..StyleA{
> }
> ..StyleB{
> padding: 6px;
> border: 1px solid rgb(102,91,86);
> }
> </style>
>
>
> <!-- START OF OUTER DIV.prism_table_contents -->
>
> <div class="ognl:(visit.selectedLSHLevel.equals('network') ? 'StyleA' :
> 'StyleB')">
>
> Some html contents here
>
> </div>
> <!-- END OF OUTER DIV.prism_table_contents -->
RE: Tapestry help needed
Posted by Adam Greene <ag...@romulin.com>.
In a case like this one, I suggest the @Any tag, so you would write it as:
<div jwcid="@Any" class="ognl:(visit.selectedLSHLevel.equals('network') ?
'StyleA' : 'StyleB')">
-----Original Message-----
From: Saldy Mathew [mailto:smathew@webifyservices.com]
Sent: Wednesday, July 23, 2003 9:19 AM
To: tapestry-user@jakarta.apache.org
Subject: Tapestry help needed
Hi,
Based on certain condition i need to apply certain class to my div tag.
StyleB is not getting applied.
Could any html experts suggest if i am doing it correctly
Here's how i am doing it
within the head section
<style>
.StyleA{
}
.StyleB{
padding: 6px;
border: 1px solid rgb(102,91,86);
}
</style>
<!-- START OF OUTER DIV.prism_table_contents -->
<div class="ognl:(visit.selectedLSHLevel.equals('network') ? 'StyleA' :
'StyleB')">
Some html contents here
</div>
<!-- END OF OUTER DIV.prism_table_contents -->