on 2023 Apr 13 4:13 PM
Is it possible to use building blocks, specifically Fields, within a Section of an ObjectPage in a Freestyle app? I'm receiving the following error message: ModuleError: failed to load 'sap/fe/macros/Field.js' from ../resources/sap/fe/macros/Field.js: script load error. Is this even possible and what should I keep in mind? I have been able to integrate the building blocks within DynamicPages or other pages.
Thanks for your help.
Best regards
Andreas
Request clarification before answering.
Hello Andreas,
It all depends on how you load your ObjectPage, i assume that you are not using the standard FE object page in this case but rather loading an own ObjectPageLayout in this case.
Then you'd fit within the `usage from custom apps` case that we describe here https://sapui5.hana.ondemand.com/test-resources/sap/fe/core/fpmExplorer/index.html#/buildingBlocks/g...
Your page need to be loaded from within an FE component and extend the base FE page controller in order to use the FE building blocks inside.
Hope that helps !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Nicolas,
thanks for your answer. Your assumption is correct that I want to use my own ObjectPageLayout. I defined my page as described in the documentation in the manifest and using the Page Controller from "sap/fe/core/PageController". Inside the ObjectPage I use section with blocks and I assume there is the problem. I define my block in two extra files as stated in the UI5 documentation (e.g. Block.js and Block.view.xml ) and the block is extending from BlockBase. Is this the problem that I'm extending there from BlockBase oder that inside the block the sap.fe.macros couldn't be loaded?
Thanks for your help. If you need any additional info, please let me know.
Best regards
Andreas
I don't know If I got it correctly.
For example I have this part in my code for the ObjectPage:
<ObjectPageSection titleUppercase="false" id="opsArticle" title="Article">
<subSections>
<ObjectPageSubSection id="opssArticle">
<blocks>
<blocks:BlockArticle id="blockArticle"/>
</blocks>
</ObjectPageSubSection>
</subSections>
</ObjectPageSection>
And my code is defined in BlockArticle.view.xml:
<VBox width="30vw">
<Text text="Field A" />
<macros:Field metaPath="A" id="fA" />
<Text text="Field B" />
<macros:Field metaPath="B" id="fB" />
</VBox>
This is my current setup where I got the error in my question. My Building Block is defined in XML but is this block loaded in JS during runtime?
If its the question how I'm creating the block, what is the right way to do it to use building blocks inside?
Thanks & Best regards
Andreas
User | Count |
---|---|
64 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.