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)
dynamic html text
digiSeryog
hi i have a Text (HTML): Co<sub>2</sub>
now i want to add a string to this html value with scripting
i tried this->text = "1.0 "+this->text;
but i get undefined
Find more posts tagged with
Comments
A@vi
<blockquote class='ipsBlockquote' data-author="'digiSeryog'" data-cid="101142" data-time="1337669181" data-date="21 May 2012 - 11:46 PM"><p>
hi i have a Text (HTML): Co<sub>2</sub><br />
<br />
now i want to add a string to this html value with scripting<br />
<br />
i tried this->text = "1.0 "+this->text;<br />
<br />
but i get undefined<br /></p></blockquote>
<br />
<br />
Can you elaborate your requirement?
digiSeryog
<blockquote class='ipsBlockquote' data-author="'A@vi'" data-cid="101169" data-time="1337700398" data-date="22 May 2012 - 08:26 AM"><p>
Can you elaborate your requirement?<br /></p></blockquote>
<br />
i just want to prepend a string in onCreate to the string but with textfield html i get undefined<br />
<br />
with dynamic text it works
CBR
the "->" is a operator of the PHP world.<br />
In java it is "."<br />
<br />
Try <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
this.text = "1.0"+this.text;
</pre>
digiSeryog
<blockquote class='ipsBlockquote' data-author="'cbrell'" data-cid="101263" data-time="1337843394" data-date="24 May 2012 - 12:09 AM"><p>
the "->" is a operator of the PHP world.<br />
In java it is "."<br />
<br />
Try <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
this.text = "1.0"+this.text;
</pre></p></blockquote>
<br />
thx i get no errors but the string doesnt change<br />
<br />
onPrepare: this.text = "asdtest";<br />
<br />
the string is still empty<br />
<br />
edit: it works with onRender but not onPrepare
CBR
I see.
You have to remember that the onPrepare method is referring to an object that is different from the object you reference in onCreate and in onRender. This is because onPrepare is looking at an meta-element while onCreate and onRender are looking at something like a filled text label.
If you want to change the content of a Text element you have to use:
1) In onPrepare: this.content = "MyContent"+this.content //will write Mycontent in front of original content
2) In onCreate and onRender: this.text = "MyContent"+this.text
digiSeryog
<blockquote class='ipsBlockquote' data-author="'cbrell'" data-cid="101271" data-time="1337861604" data-date="24 May 2012 - 05:13 AM"><p>
I see.<br />
You have to remember that the onPrepare method is referring to an object that is different from the object you reference in onCreate and in onRender. This is because onPrepare is looking at an meta-element while onCreate and onRender are looking at something like a filled text label.<br />
<br />
If you want to change the content of a Text element you have to use:<br />
<br />
1) In onPrepare: this.content = "MyContent"+this.content //will write Mycontent in front of original content<br />
<br />
2) In onCreate and onRender: this.text = "MyContent"+this.text<br /></p></blockquote>
<br />
i tried now with this.content but the value is still the same ...<br />
<br />
dynamic text (html) with value: "test"<br />
<br />
onPrepare:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
if(params["isCo2"].value == 1)
{
titleCount++;
this.content = titleCount+". CO<sub>2</sub>";
}
</pre>
<br />
output: "test" and not "1. CO2"<br />
<br />
i think i have to use unicode