cancel
Showing results for 
Search instead for 
Did you mean: 

ObjectPageHeader and Databinding

former_member187331
Participant
0 Kudos
550

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;
		},

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member187331
Participant
0 Kudos

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

junwu
Active Contributor
0 Kudos

maybe you have to check if those attributes are bindable

former_member187331
Participant
0 Kudos

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

junwu
Active Contributor
0 Kudos

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