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

List:       barracuda
Subject:    [Barracuda] FW: Barracuda:  Strange?
From:       "Christian Cryder" <christianc () granitepeaks ! com>
Date:       2003-01-24 15:27:39
[Download RAW message or body]


-----Original Message-----
From: barracuda-admin@enhydra.org [mailto:barracuda-admin@enhydra.org]On
Behalf Of Kirk Daries
Sent: Friday, January 24, 2003 8:00 AM
To: barracuda@enhydra.org
Subject: Barracuda: Strange?


Hi,

I've come across some strange behaviour when rendering one of my pages.

The bit that is giving the problem is my model that generates column totals.

The problem revolves around the following logic.

The page at any time can contain 1 to N number of columns.

If the page has no currency/numerical columns, don't display and calculate
the Page totals.
Else.
Go ahead and display the Totals.
E.g.

 <<1.jpg>>
Notice the 'Page Total' Amounts in '1.jpg'

Here's the offending html snippet.
.
.

<tr class="Dir::Get_Data.PageTotal.PageTotalRow">
 <td class="transparent"></td>
 <td class="Dir::Iterate_Start.PageTotal Dir::Iterate_Next.PageTotal
Dir::Discard">[DISCARD]</td>
 <td class="Dir::Get_Data.PageTotal.total" align="Center" valign="top">[PAGE
TOTAL]</TD>
 <td class="Dir::Iterate_End.PageTotal Dir::Discard">[DISCARD]</td>
</tr>


The bit that is giving the problem is the directive with in the <TR>
element, namely:
Dir::Get_Data.PageTotal.PageTotalRow

The 'PageTotalRow' is just used to determine if we should display the row at
all and hence loop through the columns calculating totals.

Here is the code from the model.

} else if (key.equals("PageTotalRow")) {
  if (this.userContext.getSumColumns(this.userDefinedCols)) {
    return new BComponent();
  } else {
    return null;
}

So... if totals should be calculated... a 'new BComponent' is returned...
and the rest of the directives should then be processed.

Else

Null is returned.. and the row should be 'hidden' and the rest of the
directives not processed.

But for some reason.. this is the output I'm getting(2.jpg).. as soon as I
add the 'Dir::Get_Data.PageTotal.PageTotalRow' directive to the TR.
 <<2.jpg>>
Barracuda doesn't log any warnings or errors. Notice how it ignores the
'Discard' directive as well?


At first I thought that the problem is that the 'PageTotal' model is a
IterativeModel and I can't access the 'PageTotalRow' key before the
Iterate_Start method
is reached. That said... I moved the key to a Model without the
IterativeModel interface.. with exactly the same result.

Needless to say.. I'm stumped... :(
Anyone got any ideas why I'm getting this behaviour?

Regards
KD

Ps.
If I completely remove the directive... everything works great..
but I end up with unneccesary processing on pages that don't require it...
and unneccesary output.


["1.jpg" (image/jpeg)]
["2.jpg" (image/jpeg)]

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

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