RE: Barracuda: Strange?

"Christian Cryder" <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
This email has been forwarded to the new Barracuda list at
http://barracudamvc.org, and all replies should be directed there.
----------------------------------------------
Christian Cryder [[email protected]]
Internet Architect, ATMReports.com
Barracuda - http://barracudamvc.org
----------------------------------------------
"Coffee? I could quit anytime, just not today"

> -----Original Message-----
> From: [email protected] [mailto:[email protected]]On
> Behalf Of Kirk Daries
> Sent: Friday, January 24, 2003 8:00 AM
> To: [email protected]
> 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.
>
>
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.