Skip to Content
avatar image
Former Member

Cannot add direct child without default aggregation defined for control sap.ui.core.mvc.XMLView(…)

Hi,

I have the following code in my main XML view

<mvc:View xmlns:l="sap.ui.layout" xmlns:core="sap.ui.core"
	xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" controllerName="XXX.controllers.Main"
	xmlns:html="http://www.w3.org/1999/xhtml" displayBlock="true">


	<App class="MyApp">
		<Page title="{i18n>appTitle}">
			<content>
				<l:VerticalLayout class="sapUiSmallMargin" width="100%">
					<l:content>
						<mvc:XMLView viewName="org.clalit.views.Header" />
						<l:Splitter>
							<l:contentAreas>
								<mvc:XMLView viewName="org.clalit.views.Master" height="100%" >
								 	 <mvc:LayoutData><mvc:SplitterLayoutData size="20%"/></mvc:LayoutData> 
								</mvc:XMLView>
								<mvc:XMLView viewName="org.clalit.views.Details" height="100%">
									<!-- <mvc:LayoutData><l:SplitterLayoutData size="auto"/></mvc:LayoutData> -->
								</mvc:XMLView>
							</l:contentAreas>
						</l:Splitter>
					</l:content>
				</l:VerticalLayout>
			</content>
		</Page>		
	</App>
</mvc:View>

The following line is giving me the error:

UIComponent.js:6 Uncaught Error: Cannot add direct child without default aggregation defined for control sap.ui.core.mvc.XMLView(…)

<mvc:LayoutData><mvc:SplitterLayoutData size="20%"/></mvc:LayoutData> 

What am I missing?

Aviad

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jan 04, 2017 at 07:27 AM

    Hi Aviad,

    Use layoutData.

    Instead of <mvc:LayoutData><mvc:SplitterLayoutData size="20%"/></mvc:LayoutData>, use the below code

     <layoutData><l:SplitterLayoutData size="20%"/></layoutData> 
    Add comment
    10|10000 characters needed characters exceeded