Re: Barracuda: dynamically setting the value of the class-attribute
"Andras Balogh" <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
----- Original Message ----- From: "Jan Marten Visser" <[email protected]> To: <[email protected]> Sent: Monday, March 03, 2003 16:05 Subject: Barracuda: dynamically setting the value of the class-attribute > Hi, > > I got this HTML template: > > <html> > ... > <table> > <tr> > <td class="ThisIsMyProblem" id="Name">Some text</td> > </tr> > </table> > ... > </html> > > I want to be able to change the class-attribute dynamically, when the > row is even, I want the class attribute to be "even", when it is odd I > want the attribute to be "odd". For clairity: I am using the class > attribute as a reference to a stylesheet class, the id-attribute refers > to the directives file. > > Ik know of course how to populate the tags between the <td>'s, but I > don't know how to set the tag-attributes themselves dynamically. > > Any tips? > Hi, I can't answer you question, but i would suggest using an Iterative Model to build your cells. Something like this: .. <td class="Dir::Iterate_Start.YourModel Dir::Iterate_Next.YourModel oddstyle" >Some text</td> <td class="Dir::Iterate_Next.YourModel evenstyle" >Some text</td> <td class="Dir::Iterate_End.YourModel Dir::Discard" >[End]</td> Like this you don't mix your stylesheet logic in your code. You can check out the Examples too to see how the Iterative Models work.