Creating ComponentContainer with preloaded Component with manifest
See original GitHub issueOpenUI5 version: 1.98.0 Browser/version (+device/version): Latest Chrome on Windows
I’m trying to programmatically load a Component (with manifest) into a ComponentContainer as described here: https://ui5.sap.com/#/topic/346599f0890d4dfaaa11c6b4ffa96312
Component.load({
name: "samples.components.sample",
}).then(function(oComponent) {
var oContainer = new ComponentContainer({
component: oComponent
});
// ...
});
However, I get the following error: Assertion failed: setAssociation(): sId must be a string, an instance of sap.ui.base.ManagedObject or null
I think the problem boils down to the component not being a component yet, but a function called “oClassProxy”, which doesn’t extend ManagedObject
: https://github.com/SAP/openui5/blob/master/src/sap.ui.core/src/sap/ui/core/Component.js#L2865
Maybe the documentation just is a bit fuzzy here: If my component has a manifest, am I always supposed to use the “manifest first” mode?
When I just call the method, the component is loaded just fine:
Component.load({
name: "samples.components.sample",
}).then(function(oComponent) {
var oContainer = new ComponentContainer({
component: oComponent()
});
// ...
});
Thank you very much for your support in Improving the documentation!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Hello @LukasHeimann , Thank you for sharing this finding. I’ve created an internal incident 2280047493. The status of the issue will be updated here in GitHub. Regards, Diana
Hi @LukasHeimann,
we adapted the documentation regarding
Component.load
andComponent.create
. The adaptation is already available in openui5 nightly build https://openui5nightly.hana.ondemand.com/topic/346599f0890d4dfaaa11c6b4ffa96312 and will be released with the upcoming version 1.99 as well.Best regards, Jiawei