Skip to Content

SAP UI5 Label to display ++ as SuperScript

Mar 15, 2017 at 09:34 AM


avatar image
Former Member

Need to display ++ as superscript for a label in SAP UI5. My initial approach was to extend the standard label control and have the property text as sap.ui.core.HTML type, but couldn't go forward. Need suggestions and if possible code example to do so.`

Im using n XML view for display.

<code>sap.m.Label.extend("mylabel.Label", {  
// the control API:
library : "sap.m",
metadata: {
aggregations: {
superScript: 'sap.ui.core.HTML'
properties: {
text: {
type: "sap.ui.core.HTML"
renderer: function(oRM, oControl) { // static function

sap.m.LabelRenderer.render(oRM, oControl);


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Srikanth KV Mar 15, 2017 at 03:57 PM

use HTML tags inside XML view...

<core:HTML content="<p>This text contains <sup>superscript</sup> text.</p>" />

output will be

This text contains superscript text.

10 |10000 characters needed characters left characters exceeded