cancel
Showing results for 
Search instead for 
Did you mean: 

UI5 - Failed to load 'sap/uxap/ObjectPageLayout.js'

mmitro
Discoverer
104

Hello, I'm currently doing a UI5 course and I've encountered a problem with sap.uxap library in this chapter . I used code provided in the course and I'm trying to use sap.uxap elements in Detail.view.xml

 

<mvc:View controllerName="student02.com.sap.training.ux402.listdetail.ux402listdetail.controller.Detail"
    xmlns:mvc="sap.ui.core.mvc"
    xmlns="sap.m"
    xmlns:ux="sap.uxap"
    xmlns:layout="sap.ui.layout">
    <ux:ObjectPageLayout id="objectPageLayout">
        <ux:headerTitle>
            <ux:ObjectPageDynamicHeaderTitle id="objectPageDynamicHeader">
                <ux:expandedHeading>
                    <Title
                        id="title1"
                        text="{Carrname}"
                        level="H2"/>
                </ux:expandedHeading>
            </ux:ObjectPageDynamicHeaderTitle>
        </ux:headerTitle>
        <ux:headerContent>
            <FlexBox wrap="Wrap" id="flexBox">
                <Avatar id="avatar" src="sap-icon://flight"/>
                <layout:VerticalLayout id="verticalLayout1" class="sapUiSmallMarginBeginEnd">
                    <Label id="label1" text="{Carrid}"/>
                    <Label id="label2" text="{Url}"/>
                </layout:VerticalLayout>
            </FlexBox>
        </ux:headerContent>
        <ux:sections>
            <ux:ObjectPageSection id="objectPageSection">
                <ux:ObjectPageSubSection id="objectPageSubSection1">
                    <Table id="table" headerText="{i18n>tableHeaderText}" items="{to_Connection}" 
                           noDataText="{i18n>tableNoDataText}">
                        <columns>
                            <Column id="column1">
                                <Text id="text1" text="{i18n>idColumnText}"/>
                            </Column>
                            <Column id="column2">
                                <Text id="text2" text="{i18n>cityFromColumnText}"/>
                            </Column>
                            <Column id="column3">
                                <Text id="text3" text="{i18n>cityToColumnText}"/>
                            </Column>
                        </columns>
                        <items>
                            <ColumnListItem id="columnListItem">
                                <cells>
                                    <Text id="text4" text="{Carrid}"/>
                                    <Text id="text5" text="{Cityfrom}"/>
                                    <Text id="text6" text="{Cityto}"/>
                                </cells>
                            </ColumnListItem>
                        </items>
                    </Table>
                </ux:ObjectPageSubSection>
            </ux:ObjectPageSection>
        </ux:sections>
    </ux:ObjectPageLayout>
</mvc:View>

 

Then, when I click on the button that routes to this view I get an error in the browser 

browser_error.png

I also tried to access resources link from which ObjectPageLayout.js should be accessed and there is nothing in the uxap repository ( https://port8080-workspaces-ws-clgqm.us10.trial.applicationstudio.cloud.sap/resources/sap )

sap_resource.png

Does this mean that the error is on the side of API and not in my project?

Thanks in advance for responses.

Michal

View Entire Topic
AlejoFalcone
Discoverer

Hi @mmitro  i was getting the same error as you.

Try adding the dependency for the sap.uxap library in the following files:

in the ui5.yaml

AlejoFalcone_0-1737582075779.png

In the manifest.json

AlejoFalcone_1-1737582122724.png

It worked for me !!

 

mmitro
Discoverer
0 Kudos

Hello @AlejoFalcone

Just tried it and it seems to be working for me too.

Thank you!