Skip to Content
0

ObjectPageHeader and Databinding

Dec 01, 2016 at 05:00 PM

234

avatar image

Hello Guys,
I am currently trying to code a page using ObjectPage. In this page I am trying to bind a model to the ObjectPage to show custom data on it.
Everything works well as long as I dont use a model for the ObjectPageHeader itself.
If I do so, this strange error appears:

This works:

 <mvc:View 
	xmlns:mvc = "sap.ui.core.mvc"
	xmlns:core="sap.ui.core"
	xmlns="sap.uxap"
	xmlns:layout="sap.ui.layout"
	xmlns:m="sap.m"
	height = "100%" 
	controllerName = "de.ibsolution.sapidm.ui5.controller.ViewPerson">
		<ObjectPageLayout 
			showTitleInHeaderContent="true"
			
		>
			<headerTitle>
				<ObjectPageHeader 
					id="testHeader"
					objectImageURI="img/test.jpg"
					objectTitle="Test"
					objectImageShape="Circle"
					objectImageAlt="TestUser"
					objectSubtitle="ID"
					isObjectIconAlwaysVisible="false"
					isObjectTitleAlwaysVisible="false"
					isObjectSubtitleAlwaysVisible="false">
				</ObjectPageHeader>
			</headerTitle>
			<headerContent>
				<layout:VerticalLayout>
					<m:Link text="{SV_MX_PHONE_PRIMARY}"/>
					<m:Link text="{SV_MX_MAIL_PRIMARY}"/>
				</layout:VerticalLayout>
	 
				<layout:HorizontalLayout>
					<m:Image src="img/linkedin.png"></m:Image>
					<m:Image src="img/Twitter.png"></m:Image>
				</layout:HorizontalLayout>
	 
				<layout:VerticalLayout>
					<m:Label text="Employed"/>
					<m:Label text="Testuser"/>
					<m:Label text="01.10.2016 - 01.10.2099"/>
				</layout:VerticalLayout>
	 
				<layout:VerticalLayout>
					
				</layout:VerticalLayout>
			</headerContent>
			<sections>
			</sections>
		</ObjectPageLayout>
</mvc:View>

This does not:

<ObjectPageHeader 
					id="testHeader"
					objectImageURI="img/test.jpg"
					objectTitle="{SV_DISPLAYNAME}"
					objectImageShape="Circle"
					objectImageAlt="{SV_DISPLAYNAME}"
					objectSubtitle="{ID}"
					isObjectIconAlwaysVisible="false"
					isObjectTitleAlwaysVisible="false"
					isObjectSubtitleAlwaysVisible="false">
				</ObjectPageHeader>

What am I doing wrong?


//Controller Code:

onInit: function (oEvent) {
			var oModel = new JSONModel(this._loadUsersData(this));
			this.getView().setModel(oModel);
			this.currentController = this;
		},
err1.png (16.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jun Wu Dec 01, 2016 at 05:42 PM
0

can u use full path like {/SV_DISPLAYNAME} for all your binding

Share
10 |10000 characters needed characters left characters exceeded
Aydin Tekin Dec 02, 2016 at 10:12 AM
0

Hello Jun Wu,

the binding is ok. Like you see, in the headerContent it does work:

<layout:VerticalLayout>
   <m:Link text="{SV_MX_PHONE_PRIMARY}"/>
   <m:Link text="{SV_MX_MAIL_PRIMARY}"/>
</layout:VerticalLayout>

Only using it in the Header itself triggers this error!

Regards, Aydin

Show 2 Share
10 |10000 characters needed characters left characters exceeded

maybe you have to check if those attributes are bindable

0

Sorry for the late answer. For everyone experiencing this issue: Update your UI5-Libraries!

0