Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
can i pass the report element to the global function?
yaragallamurali
<p>Hi in the script of the report i have written a global function as below:-</p><pre class="_prettyXprint _lang-">function abc(element){ element.content="hurray";}</pre><p>after this in the "dynamic text element" expression builder i have called the global function as below:-</p><pre class="_prettyXprint _lang-">abc(this);</pre><p>what i want to do is, i want to change the content property of the text element in the global function. But this is not working. Is this possible?</p>
Find more posts tagged with
Comments
yaragallamurali
<p>Any help on this?</p>
CBR
<p><sub class='bbc'>Yes it is possible. Just pass in a reference to the text element.</sub></p><p> </p><p><sub class='bbc'>The expression you are using is not valid because using this in expression builder does not give you a reference to the text element.</sub></p>
yaragallamurali
<blockquote class="ipsBlockquote" data-author="cbrell" data-cid="120955" data-time="1380826991"><div><p><sub class='bbc'>Yes it is possible. Just pass in a reference to the text element.</sub></p><p> </p><p><sub class='bbc'>The expression you are using is not valid because using this in expression builder does not give you a reference to the text element.</sub></p></div></blockquote><p>Your answer is very simple and i am a beginner. i want to pass the element to the global function. So can give a little bit more explanation and sample code if possible. What is meant by "pass in a reference to the text element"? do u mean to say pass the reference of the text element to global function? if so how? is it through script in the element? </p>
CBR
<p>Can you describe what you want to achieve? If it is just changing the content of a text element:</p><p>Why don't you use dynamic text?</p><p> </p><p>If you can explain your requirements i can provide a sample report.</p>
yaragallamurali
<blockquote class="ipsBlockquote" data-author="cbrell" data-cid="120960" data-time="1380828381"><div><p>Can you describe what you want to achieve? If it is just changing the content of a text element:</p><p>Why don't you use dynamic text?</p><p> </p><p>If you can explain your requirements i can provide a sample report.</p></div></blockquote><p>I dont have requirement as such in hand. In java script it is possible to pass html element using "this" to a function. So i wanted to know whether it is possible in birt. If so where is the appropriate place to use "this". I mean if we use "this" in script of the element rather than in expression builder will it be fine?</p>
CBR
<p>Exactly:</p><p>The event handler script of an element is the correct place to use this.</p>
yaragallamurali
<blockquote class="ipsBlockquote" data-author="cbrell" data-cid="120970" data-time="1380872940"><div><p>Exactly:</p><p>The event handler script of an element is the correct place to use this.</p></div></blockquote><p>Thank you so much.</p>