[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    RE: Component with mixed functionality?
From:       Kristian Marinkovic <kristian.marinkovic () porsche ! co ! at>
Date:       2007-12-11 11:30:47
Message-ID: OF982CFFEC.26452CF1-ONC12573AE.003E6C1E-C12573AE.003F2E99 () porsche ! co ! at
[Download RAW message or body]

--=_alternative 003F2E98C12573AE_=
Content-Type: text/plain; charset="US-ASCII"

have you tried:
<tr class="ognl:cssClass" jwcid="@If" condition="...

public String getCssClass() {...}

informal parameters are allowed and by default the tag will be rendered:
http://tapestry.apache.org/tapestry4.1/components/general/if.html

see also:
http://www.nabble.com/Brain-Freeze-Assistence-Please-to1017361.html#a1017361

g,
kris



Kaspar Fischer <fischerk@inf.ethz.ch> 
11.12.2007 10:09
Bitte antworten an
"Tapestry users" <users@tapestry.apache.org>


An
Tapestry users <users@tapestry.apache.org>
Kopie

Thema
Component with mixed functionality?







Hi!

My page needs to output a table with a fixed, predefined number of rows.
Some of these rows may have empty content and should not be rendered.
Each row has a different type (one is a date, another a string, etc.)
and I want a class of "even" or "odd", respectively, be attached to 
<tr>.

My first attempt was

  <table>
   <tr class="even" jwcid="@If" condition="ognl:object.getProperty 
('title').length()>0">
    <td><span key="object-title">Title</span></td>
    <td><span jwcid="@Insert" value="ognl:object.getProperty 
('title')"/></td>
   </tr>
   <!-- ... and a <tr> for each of the additional properties ... -->

The problem is: the <tr> already is a component (@If) but I need to
attach additional behaviour (class should alternate between "even" and
"odd"). What's an easy way to accomplish this?

Thanks,
Kaspar

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



--=_alternative 003F2E98C12573AE_=--
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic