hiding an element in the ROM [message #202279] |
Wed, 22 November 2006 00:02 |
Eclipse User |
|
|
|
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 |
|
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 |
Eclipse User |
|
|
|
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 #203054 is a reply to message #202488] |
Mon, 27 November 2006 16:09 |
|
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?
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03539 seconds