-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi
I have a label which has text in, on the server I want to pass the text to this label via a renderer but I also want to make certain parts of the text bold / different font color etc. Is this possible?
Hey Bobtedbob,
There is no way to set different style within 1 label.
There are 3 solutions what you can do.
As Darksu already mentioned, you can use a hlayout
where you put children
attribute for the children and so dynamicly construct different labels with there styles.
Use ckeditor in stead of label. ckeditor is a textbox who supports html(and create html output when you type). The problem here is it's not a label.
Use htmlNativeComponent.
This is possible when your text in controller or viewmodel is already html style with the colors.
Example use :
Hlayout parent; // this must be wired in controller or use @selectorParam in viewmodel
HtmlNativeComponent n = new HtmlNativeComponent("html", myString, "");
parent.getChildren().clear();
parent.appendChild(n);
Greetz chill.
You can use a html component to enclose the html content.
Asked: 2015-10-08 11:35:53 +0800
Seen: 43 times
Last updated: Oct 08 '15
How to do ${c:l(@load(vm.name)} correctly?
how to specify line break in label. [closed]
Label text does not wrap in a "scrollview"
How to include a single special utf-8 character in a treecol label string?
Placeholder with phonemasking in IE11 Browser not working
how to change the style of portion of Label's value
How to get a label value for all the different international label file?