You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Anders Vesterberg <an...@vesdakon.se> on 2003/05/23 16:47:34 UTC

Q: options (class) for depends on columnValue

Hi
I am working on a page with a table where background color
 of cell should change dependent upon columnValue. I would
 like to control with different .css. I am experimenting
 with SimpleTableValueRendererSource, but as far as I can
 see that affects presentation of the value/string. I would
 like to change options on <td>. I am working on a custom
 TableValues components, but cannot get at it. Can someone
 give me a hint? I am using Tapestry 2.3.
/Anders Vesterberg
www.vesdakon.se
Server-side Java Development

Re: Q: options (class) for depends on columnValue

Posted by Barry Books <tr...@gmail.com>.
I did this by overridding the insert component with one that outputs a
class based on the datatype. Min and Max might be more of a problem
because when you override the component it will happen everywhere,
however I think you might be able to control this by putting the page
in a library. On the other hand you could fix this by making the css
something like

td .max {
color: red;
}

I also have stuff like
td .Integer {
text-align: right;
}

Barry

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Q: options (class) for depends on columnValue

Posted by Daniel Jue <te...@gmail.com>.
I would also like to know this one...
I want to make the min/max numbers of a column look different from the
rest, or similarly, have values beyond a determined threshold display
in bold or a different color.

So far I've only used the even-odd bean to change css styles.  I'm
don't think a bean is sufficient, unless it can somehow inspect the
values being rendered.

Dan

On 1/25/07, kmadha <km...@yahoo.com> wrote:
> Anders Vesterberg <anders <at> vesdakon.se> writes:
>
> >
> > Hi
> > I am working on a page with a table where background color
> >  of cell should change dependent upon columnValue. I would
> >  like to control with different .css. I am experimenting
> >  with SimpleTableValueRendererSource, but as far as I can
> >  see that affects presentation of the value/string. I would
> >  like to change options on <td>. I am working on a custom
> >  TableValues components, but cannot get at it. Can someone
> >  give me a hint? I am using Tapestry 2.3.
> > /Anders Vesterberg
> > www.vesdakon.se
> > Server-side Java Development
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe <at> jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help <at> jakarta.apache.org
> >
> >
>
> Hello,
> I also want to perform similar thing. I want one of my table columns to have
> different background color. For e.g: a start columm 'index'column should have
> gray background but rest of the columns should follow odd-even bean coloring.
> Is this possible?
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Q: options (class) for depends on columnValue

Posted by kmadha <km...@yahoo.com>.
Anders Vesterberg <anders <at> vesdakon.se> writes:

> 
> Hi
> I am working on a page with a table where background color
>  of cell should change dependent upon columnValue. I would
>  like to control with different .css. I am experimenting
>  with SimpleTableValueRendererSource, but as far as I can
>  see that affects presentation of the value/string. I would
>  like to change options on <td>. I am working on a custom
>  TableValues components, but cannot get at it. Can someone
>  give me a hint? I am using Tapestry 2.3.
> /Anders Vesterberg
> www.vesdakon.se
> Server-side Java Development
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe <at> jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help <at> jakarta.apache.org
> 
> 

Hello,
I also want to perform similar thing. I want one of my table columns to have 
different background color. For e.g: a start columm 'index'column should have 
gray background but rest of the columns should follow odd-even bean coloring.
Is this possible?




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: options (class) for depends on columnValue

Posted by Mind Bridge <mi...@yahoo.com>.
Hi,

	The TableValues component's attributes are passed down to the <td>. In
other words, the <td> tag 'inherits' the informal parameters passed to
TableValues.

	To achieve what you want you can simply bind the 'class' parameter (or any
other informal one) of TableValues to the class value you want. e.g:

	<component id="..." type="TableValues">
		...
		<binding name="class" expression="tdClass"/>
	</component>

	This will get the class of <td> using getTdClass(). Combined with
TableRows' "value" and TableValues' "column" parameter you should have all
the information you would need if the class is to be dynamic.

	Btw, the Table component (the facade) also has all of those bindings, so
you would not need to go down to the lower level components if you do not
want to -- see the "valuesClass", "row", "column" parameters, which should
be identical to the ones mentioned above.

	One last warning -- I do not have access to the repository now, so some of
those parameters might only be available in the 2.4 version. I am pretty
sure that the informal parameter trick (e.g. "class" for TableValues) works
in 2.3, however.


Best regards,
-mb


-----Original Message-----
From: Anders Vesterberg [mailto:anders@vesdakon.se]
Sent: Friday, May 23, 2003 5:48 PM
To: tapestry-user@jakarta.apache.org
Subject: Q: options (class) for <td> depends on columnValue


Hi
I am working on a page with a table where background color
 of cell should change dependent upon columnValue. I would
 like to control with different .css. I am experimenting
 with SimpleTableValueRendererSource, but as far as I can
 see that affects presentation of the value/string. I would
 like to change options on <td>. I am working on a custom
 TableValues components, but cannot get at it. Can someone
 give me a hint? I am using Tapestry 2.3.
/Anders Vesterberg
www.vesdakon.se
Server-side Java Development

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org