1
votes


I searched the answer to this question but every solution that I found did not work, so I'm starting to think that probably my problem is at a higher level (but the official and unofficial SAP guides did not help).

I have a Fiori Master-Detail application, and my detail view is the following:

    <mvc:View
        controllerName="masterdetailsample.controller.Detail"
        xmlns="sap.m"
        xmlns:l="sap.ui.layout"
        xmlns:core="sap.ui.core"
        xmlns:mvc="sap.ui.core.mvc"
        xmlns:semantic="sap.m.semantic">

    <semantic:DetailPage
        id="page"
        navButtonPress="onNavBack"
        showNavButton="{device>/system/phone}"
        title="{i18n>detailTitle}"
        busy="{detailView>/busy}"
        busyIndicatorDelay="{detailView>/delay}">

        <semantic:content>
            <ObjectHeader
                id="objectHeader"
                title="{EmployeeID}">
            </ObjectHeader>
            <l:VerticalLayout>
                <IconTabBar
                    id="iconTabBar"
                    class="sapUiResponsiveContentPadding"
                    upperCase="true">
                    <items>
                        <IconTabFilter
                            id="detailIconTabBarInfo"
                            text="{i18n>detailIconTabBarInfo}"
                            tooltip="{i18n>detailIconTabBarInfo}">

                            <Toolbar design="Solid">
                                <content>
                                    <Title 
                                        text="{i18n>detailIconTabBarInfo}"
                                        width = "100%">
                                    </Title>
                                </content>  
                            </Toolbar>

                            <core:Fragment id="perfEval" fragmentName="masterdetailsample.view.viewcomponents.PerformanceDevelopment" type="XML"/>
                            <mvc:XMLView id="compOvw" viewName="masterdetailsample.view.viewcomponents.PerformanceDevelopment" displayBlock="true"/>

                        </IconTabFilter>
                    </items>    
                </IconTabBar>
            </l:VerticalLayout>
        </semantic:content>
    </semantic:DetailPage>
</mvc:View>

And my fragment page is the following:

<core:FragmentDefinition
    xmlns="sap.m" 
    xmlns:core="sap.ui.core" 
    xmlns:l="sap.ui.layout" 
    xmlns:f="sap.ui.layout.form" 
    xmlns:mvc="sap.ui.core.mvc">
    <Text>
        FRAGMENT CONTENT
    </Text>
</core:FragmentDefinition>

While the xmlview is:

<mvc:View
    xmlns="sap.m" 
    xmlns:core="sap.ui.core" 
    xmlns:l="sap.ui.layout" 
    xmlns:f="sap.ui.layout.form" 
    xmlns:mvc="sap.ui.core.mvc"
    controllerName="masterdetailsample.controller.PerformanceDevelopment">
    <Text>
        FRAGMENT CONTENT
    </Text>
</mvc:View>

I tried every combination that I have been capable to think of but the page does not render.
Now I know that fragments and xmlviews must be surrounded by an aggregator that cannot be the "content" tag of sap.m. So I tried with "VerticalLayout" and "content" from sap.ui.layout, moving them through the page but still the browser complains about the use of the correct aggregator (from the ff console "Cannot add text nodes as direct child of an aggregation. For adding text to an aggregation, a surrounding html tag is needed: FRAGMENT CONTENT").
I have read that view must be declared into manifes.json, but if I understood correctly, only if this pages are "standalone". I thought that this is not my case since I would reuse many of this subview or fragment in my application.
I checked if I have some refuse or some wrong code left during my different attempt but everything seems correct.
I thought that maybe xmlviews and fragments cannot be used inside sap.m.semantic.DetailPage but I haven't found any evidence of this through the SAP doumentation.
It is correct to structure a detail page as I have done? Can an IconTabFilter contains a subview or a fragment or it is better to design the page in another fashion? Every time that I change something I don't know if it does not work because of conceptual or design mistake and I'm a little frustrated by this.

Thank you all

1

1 Answers

0
votes

The error is caused by <Text> FRAGMENT CONTENT </Text>. You cannot enter text directly into the <Text> tag. You need to use <Text text="FRAGMENT CONTENT"/>.

The rest of the code seem fine.