Re: Newbie question - BTemplate/Directives/Tables

Jacob Kjome <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
You can try using the Dir::Set_Attr directive.

See the following for understanding how the various directives work...
http://barracudamvc.org/Barracuda/docs/comp/tutorial_hello_world2.html#Understanding_Directives

See HelloWorld2b in the component tutorial for an example...
http://barracudamvc.org/Barracuda/docs/comp/tutorial_hello_world2b.html

Look at the HelloWorld2b2 template where it has...

<table summary="" class="Dir::Set_Attr.HelloWorld.Summary.summary">

The corresponding code fills the "summary" attribute with the data returned 
in the HelloWorld model with the "Summary" key...

in 
http://barracudamvc.org/Barracuda/src/org/enhydra/barracuda/tutorials/comp/HelloWorld2b.java 
...
...
...
else if (key.equals("Summary")) return "Shopping List Table";
...
...

I believe you could also return null so that it wouldn't add a "summary" 
attribute.  However, I haven't tested that.  If that would work, then you 
could selectively set an attribute only when you really need it.


Jake




At 10:38 PM 3/3/2003 +0100, you wrote:
>Hi all !
>
>I'm new to this mailing list and I need some help
>when using the BTemplate component with tables:
>
>I have a table where some of the rows - not following a certain pattern -
>need to have
>a different color that the others depending on a certain condition.
>So I added a directive - Dir::Get_Data.SomeModel.row - to the <tr> element
>together
>with the Iterate_Start and Iterate_Next directives,
>so that I can define a bgcolor attribute when needed.
>But what do I need to return in my Model (which implements IterativeModel)
>in getItem(key) for the row directive ?
>I'd like to maintain the <tr> element as it is defined in my HTML file
>and just add a bgcolor="..." attribute to it depending on a certain
>condition.
>
>Any help is highly appreciated.
>Thanks and greets,
>
>Thorsten
>
>_______________________________________________
>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.