Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » hiding an element in the ROM
hiding an element in the ROM [message #202279] Wed, 22 November 2006 00:02 Go to next message
Eclipse UserFriend
Originally posted by: goykhmanster.gmail.com

Hi all

I am trying to conditionally hide an element if a certain counter variable
reaches a certain value as rows keep rendering. However, it doesn't work,
because i don't know how to handle ROM elements via javascript. I am
using BIRT 2.0.2 and I added the following event handlers for the table:

<method name="onPrepare"><![CDATA[var countRecords =
0;]]></method>
<method name="onRender"><![CDATA[if (countRecords > 200) {
document.getElementById('107').style.display = 'none';
}]]></method>


and the following event handler for every row:

<method name="onRender"><![CDATA[countRecords++;]]></method>


The code inside 'if' statement is obviously wrong, so if someone could
point out how to hide a ROM element, i would greatly appreciate it.

Thanks
Re: hiding an element in the ROM [message #202473 is a reply to message #202279] Wed, 22 November 2006 16:04 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

try removing the var keyword, it should make the variable global.
Dont use the if statement here. You can but it is better to just use the
visibility property for the elment. In the visibillity expression put
something like
if( countRecords > 200 ){
true;
}else{
false;
}

Jason

"Boris" <goykhmanster@gmail.com> wrote in message
news:11d5b00397f7e61f35a18958b6d8563e$1@www.eclipse.org...
> Hi all
>
> I am trying to conditionally hide an element if a certain counter variable
> reaches a certain value as rows keep rendering. However, it doesn't work,
> because i don't know how to handle ROM elements via javascript. I am
> using BIRT 2.0.2 and I added the following event handlers for the table:
>
> <method name="onPrepare"><![CDATA[var countRecords =
> 0;]]></method>
> <method name="onRender"><![CDATA[if (countRecords > 200) {
> document.getElementById('107').style.display = 'none';
> }]]></method>
>
> and the following event handler for every row:
>
> <method name="onRender"><![CDATA[countRecords++;]]></method>
>
>
> The code inside 'if' statement is obviously wrong, so if someone could
> point out how to hide a ROM element, i would greatly appreciate it.
>
> Thanks
>
Re: hiding an element in the ROM [message #202488 is a reply to message #202473] Wed, 22 November 2006 16:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: goykhmanster.gmail.com

Jason

Thanks for your response.

The problem is, however, the element that i want to hide renders BEFORE
the data table starts rendering. Therefore, if i use condition
countRecords>200 for it, it will read countRecords variable's value at the
time when it was first initialized when it is still 0.

This is why i'm trying to execute something at the time when the table
finishes rendering (onRender method is the right place for that, right?).

Is there a way to apply a visibility property to an element dynamically
via the script or anything else?
Re: hiding an element in the ROM [message #202495 is a reply to message #202473] Wed, 22 November 2006 16:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: goykhmanster.gmail.com

... and i tried removing 'var' keyward and updated the visibility
expression, and it produces the same result.
Re: hiding an element in the ROM [message #203054 is a reply to message #202488] Mon, 27 November 2006 16:09 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Try setting this in the onRender event.
//this.getStyle().visibleFormat = "'pdf'";

//this.getStyle().visibleFormat = "'html'";

this.getStyle().visibleFormat = "'all'";



Jason


"Boris" <goykhmanster@gmail.com> wrote in message
news:7e049481b76846d31a634a9cf26fb169$1@www.eclipse.org...
> Jason
>
> Thanks for your response.
>
> The problem is, however, the element that i want to hide renders BEFORE
> the data table starts rendering. Therefore, if i use condition
> countRecords>200 for it, it will read countRecords variable's value at the
> time when it was first initialized when it is still 0.
> This is why i'm trying to execute something at the time when the table
> finishes rendering (onRender method is the right place for that, right?).
>
> Is there a way to apply a visibility property to an element dynamically
> via the script or anything else?
>
>
>
Previous Topic:For Jason:Null Ptr Exceptn on running MS SQL Query from a scripted database
Next Topic:HowTo - Custom Series for Charts
Goto Forum:
  


Current Time: Tue Apr 23 09:27:33 GMT 2024

Powered by FUDForum. Page generated in 0.03539 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top