Skip to Content

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

Oct 26, 2017 at 11:50 AM


avatar image

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?

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

1 Answer

Jun Wu 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) {

Show 1 Share
10 |10000 characters needed characters left characters exceeded

I've tried as your suggestoin. Looks not working :(.