Skip to Content
avatar image
Former Member

SAP UI5 Label to display ++ as SuperScript

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);

}

});
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • 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.

    Add comment
    10|10000 characters needed characters exceeded