Re: dynamically setting the value of the class-attribute REISSUE

"James Pearson" <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <00ea01c2e19e$2cb70730$229dbdc0@ariel>
Hi Jan,

simple solution really, in your model you can just use the setAttr() method on your BComponent to
set the
class attribute from the server:

someBComponent.setAttr("class", someClass);

HTH,

James.

----- Original Message -----
From: "Jan Marten Visser" <[email protected]>
To: <[email protected]>
Sent: Monday, March 03, 2003 2:49 PM
Subject: [Barracuda] dynamically setting the value of the class-attribute REISSUE


> Hi,
>
> I got this HTML template:
>
> <html>
> ...
> table>
>   <tr id="sec_startIter">
>     <td class="ThisIsMyProblemReadBelow" id="Name">Some text</td>
>   </tr>
> </table id="sec_endIter">
> ...
> </html>
>
>
> I have got the following directives file:
> Name = Dir::Get_Data.Model.Name
> sec_startIter=Dir::Iterate_Start.Model Dir::Iterate_Next.Model
> sec_endIter=Dir::Iterate_End.Model Dir::Discard
>
> 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.
>
> I have tried:
>
> <html>
> ...
> table>
>   <tr id="sec_startIter">
>     <td class="Dir::Get_Data.Model.StylesheetClass" id="Name">Some
> text</td>
>   </tr>
> </table id="sec_endIter">
> ...
> </html>
>
> This does not work, because I get the value of
> Dir::Get_Data.Model.StylesheetClass as a cell in the table, something
> like
>
> ....
> <td>even</td>
> ....
>
> So I can't get the value of the class-attribute to be set dynamically by
> Barracuda.
>
> Any tips?
>
>
> PS I reposted this question because I am changing from the old list to
> the new list, and I forgot to mention that I am already using the
> iterate functions, apologies for the redundancy.
>
> _______________________________________________
> Barracuda mailing list
> [email protected]
> http://barracudamvc.org/lists/listinfo/barracuda
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.