Skip to Content
avatar image
Former Member

How to ensure a component is loaded after a library is loaded

Hi Experts,

I met a strange thing when using richtextEditor with type M

<script id="sap-ui-bootstrap"

....

data-sap-ui-libs="sap.ui.richtexteditor, sap.m"

Then I can get the fiori editor expected.

However, If I remove it from "data-sap-ui-libs" but add a new line in my component's meta data like below

"dependencies": {

"minUI5Version": "1.48.0",

"libs": { "sap.ui.core": {}, "sap.m": {}, "sap.ui.layout": {}, "sap.ushell": {}, "sap.collaboration": {}, "sap.ui.comp": {}, "sap.uxap": {}, "sap.ui.richtexteditor" :{} } },

I can't see the customized fiori toobar.

Is there anything wrong? I guess add sap.ui.richtexteditor in dependencies of component, then the component will load all the source of it but what I observed is no.

As the component is used by other app, I can't ask the user add things in their index.html. I'm looking for a solution to ensure it loaded in component.js

Any idea?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 26, 2017 at 12:37 PM

    when you define your component, put that in dependency list

    sap.ui.define([ "sap/ui/core/UIComponent", "sap/ui/model/json/JSONModel",
    "sap/ui/model/odata/ODataModel", "sap/ui/Device"

    ], function(UIComponent, JSONModel, ODataModel, Device) {

    Add comment
    10|10000 characters needed characters exceeded