$(function () { pageContext.i18n.modTalk = 'moderation talk'; pageContext.i18n.replyToComment = 'Reply'; pageContext.i18n.modTalkEmpty = 'moderation talk is empty'; pageContext.url.getModTalk = "/comments/%25ID%25/listModTalk.json"; pageContext.url.possibleCommentRecipients = "/comments/%ID%/possibleRecipients.json"; pageContext.url.commentEdit = '/comments/%25ID%25/edit.html'; pageContext.url.commentView = '/comments/%ID%/view.html'; pageContext.i18n.commentVisibility = { 'full': 'Viewable by all users', 'op': 'Viewable by the original poster', 'mod': 'Viewable by moderators', 'opAndMod': 'Viewable by moderators and the original poster', 'other': 'Advanced visibility', 'dialogTitle': 'Comment visibility', 'selectGroups': 'Visible to groups', 'selectOther': 'Other recipients', 'selectOriginalPoster': 'Original poster', 'selectModerators': 'Moderators', 'selectAssignees': 'Asked to answer users' }; pageContext.i18n.commentMenuLabels = { 'comment-edit': 'comments.menu.edit', 'comment-delete': 'comments.menu.delete', 'comment-convert': 'comments.menu.convert' };pageContext.i18n.answer= { bestAnswer: 'Best Answer', controlBar : { accept: 'Accept', unaccept: 'Unaccept', acceptCommand: 'Accept this answer as correct', cancelAcceptedCommand: 'Remove this answers accepted status' } }; window.croles = { u: false, op: false, m: false, og: false, as: false, ag: false, dc: false, doc: false, eo: false, ea: false }; tools.init({ q: { e: false, ew: false, eo: false, r: false, ro: false, d: false, dow: false, fv: false, c: false, co: false, p: false, tm: false , ms: false, mos: false }, n: { f: false, vf: false, vfo: false, vr: false, vro: false, c: false, co: false, vu: false, vd: false, w: false, wo: false, l: false }, c: { e: false, eo: false, d: false, dow: false, ta: false, tao: false, l: false }, a: { e: false, ew: false, eo: false, d: false, dow: false, a: false, aoq: false, ao: false, tc: false, tco: false, p: false, tm: false }, pc: croles }, { tc: true, nsc: true }); commandUtils.initializeLabels(); }); Skip to Content
0

ObjectPageLayout

Jan 31, 2017 at 10:31 AM

82

avatar image

Hi,

When i had used the below code output is displaying with out using the ObjectPageLayout Control.

please see the below code ,I had used content="{invoice2>/UserDetails}" to bind the OData .

<m:Page id="idPage" enableScrolling="true" title="{i18n>userProfileApp}" showNavButton="false" navButtonPress="navButtonPress" >

<layout:Grid defaultIndent="L0 M0 S0" defaultSpan="L6 M6 S6" position="Left" width="100%" containerQuery="false" hSpacing="0" vSpacing="0">

<layout:Grid content="{invoice2>/UserDetails}" id="headerContentUserProfile" defaultIndent="L0 M0 S0" defaultSpan="L12 M12 S12" position="Left" width="100%" containerQuery="false" hSpacing="0" vSpacing="0">

<layout:content>

<m:HBox>

<m:Text text="{i18n>company}:" width="7rem" maxLines="1" wrapping="false" textAlign="Begin" textDirection="Inherit" />

<m:Text text="{invoice2>Company}" width="auto" maxLines="1" wrapping="false" textAlign="Begin" textDirection="Inherit" />

</m:HBox>

</layout:content>

</layout:Grid>

</layout:Grid>

Now I am using the ObjectPageLayout ,please see the below code related to that now the output is not displaying and i am not seeing any error.Could any one help on this

<m:Page id="idPage" enableScrolling="true" title="{i18n>userProfileApp}" showNavButton="false" navButtonPress="navButtonPress" >

<ObjectPageLayout>

<headerContent>

<layout:Grid defaultIndent="L0 M0 S0" defaultSpan="L6 M6 S6" position="Left" width="100%" containerQuery="false" hSpacing="0" vSpacing="0">

<layout:Grid content="{invoice2>/UserDetails}" id="headerContentUserProfile" defaultIndent="L0 M0 S0" defaultSpan="L12 M12 S12" position="Left" width="100%" containerQuery="false" hSpacing="0" vSpacing="0">

<layout:content>

<m:HBox>

<m:Text text="{i18n>company}:" width="7rem" maxLines="1" wrapping="false" textAlign="Begin" textDirection="Inherit" />

<m:Text text="{invoice2>Company}" width="auto" maxLines="1" wrapping="false" textAlign="Begin" textDirection="Inherit" />

</m:HBox>

</layout:content>

</layout:Grid>

</layout:Grid>

</headerContent>

</ObjectPageLayout>

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

VIPLOVE KHUSHALANI Jan 31, 2017 at 11:40 AM
0

Hi Durga ,

Can you just try binding element to the object page layout ... like bindElement("invoice2>/")

thanks

Viplove

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

I tried using the below code in controller but still i am not able to bind data

this.getView().byId("ObjectPageLayout").bindElement("invoice2>/UserDetails");

0

Is it possible to put your working code in Plunker and share the link , so that i can take a look and analyse what could be the error

thanks

Viplove

0

Hi Viplove,

i had shared the total code in the below link

https://plnkr.co/edit/2sVevgVbpQNtZcW6RodS?p=catalogue

and please let me know if you have any questions

0
Durga Vemula Feb 01, 2017 at 12:23 PM
0

Hi Viplove,

I am Sorry i am in office and i cannot share the link.

And now i am trying Vertical layout also in the ObjectPagelayout still i am not able to bind it.

Please find the View Code

UserProfileList.view.xml

http://www.w3.org/1999/xhtml" xmlns="sap.uxap" xmlns:layout="sap.ui.layout" xmlns:m="sap.m" xmlns:form="sap.ui.layout.form" height="100%">

<ObjectPageLayout id="ObjectPageLayout" enableLazyLoading="false" showTitleInHeaderContent="true" showEditHeaderButton="true" editHeaderButtonPress="handleEditBtnPress" >

<headerTitle>

<ObjectPageHeader objectImageURI="./localService/assets/default.png" objectTitle="{invoice2>Fullname}" objectImageShape="Circle" objectImageAlt="Denise Smith" objectSubtitle="Senior UI Developer" isObjectIconAlwaysVisible="false" isObjectTitleAlwaysVisible="false" isObjectSubtitleAlwaysVisible="false">

</ObjectPageHeader>

</headerTitle>

<headerContent>

<layout:VerticalLayout>

<m:Link text="{invoice2>Fullname}"/>

</layout:VerticalLayout>

</headerContent>

</ObjectPageLayout>

</mvc:View>

Please find the Controller code

UserProfileList.controller.js

sap.ui.define([ "sap/ui/core/mvc/Controller" ],

function(Controller)

{

"use strict";

return Controller.extend("usrprofile.app.controller.UserProfileList",

{

onInit: function() {

this.getView().setModel(this.getView().getModel("invoice2"));

this.getView().byId("ObjectPageLayout").bindElement("invoice2>/UserDetails");

}

});

});

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

can you change this.getView().setModel(this.getView().getModel("invoice2")); to

this.getView().setModel(sap.ui.getCore().getModel("invoice2"));

as invoice2 is a global model in your project which is accessible by every view.

thanks

0

In Plunker your code is different than above ..

{invoice2>/Fullname} - means binding aggregation //incorrect

{invoice2>Fullname} - means binding property // correct

I think you are not clear when to do aggregation binding and when to do property binding

And can you show the structure of your output data coming from service , so that i can understand where to provide aggregation binding and where property binding needs to be there.

thanks

viplove

0

Hi Vilove,

Sorry i was trying different options and i had kept {invoice>/Fullname} and i had changed to {invoice2>Fullname} and also changed the Controller code this.getView().setModel(sap.ui.getCore().getModel("invoice2")); but still output is not coming.

In the plunker i had added 2 files

1)metadata - Metadata of the service

2)output - output of the service

could you please look and help me on this.

please find the below link of the plunker

https://plnkr.co/edit/2sVevgVbpQNtZcW6RodS?p=catalogue

0

Hi Vilove,

Sorry i was trying different options and i had kept {invoice>/Fullname} and i had changed to {invoice2>Fullname} and also changed the Controller code this.getView().setModel(sap.ui.getCore().getModel("invoice2")); but still output is not coming.

In the plunker i had added 2 files

1)metadata - Metadata of the service

2)output - output of the service

could you please look and help me on this.

please find the below link of the plunker

https://plnkr.co/edit/2sVevgVbpQNtZcW6RodS?p=catalogue

0

HI Vilove,

Could you please help on this.

I had updated all the files which you had asked.

1)metadata - Metadata of the service

2)output - output of the service

0

HI Vilove,

Could you please help on this.

I had updated all the files which you had asked.

1)metadata - Metadata of the service

2)output - output of the service

please find the below link of the plunker which i had updated

https://plnkr.co/edit/2sVevgVbpQNtZcW6RodS?p=catalogue

0

Hi ,

Sorry got busy in projects , not able to solve your query ... will look into your code and get back to u as soon as possible

thanks

Viplove

0