openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

Questions about sap.uxap.ObjectPageHeader/ObjectPageLayout

Open TinaC opened this issue 9 years ago • 2 comments

I want to use editHeader button in object header. Since sap.m.ObjectHeader has no editHeader button, I changed to sap.uxap.ObjectPageLayout.

But I found several problems about it:

<uxap:ObjectPageLayout id="ObjectPageLayout"
    enableLazyLoading="false"
    showTitleInHeaderContent="true"
    showEditHeaderButton="true"
    editHeaderButtonPress="handleEditBtnPress">
    <uxap:headerTitle>
        <uxap:ObjectPageHeader
            showTitleSelector="false"
            showMarkers="false"
            showPlaceholder="false"
            isObjectTitleAlwaysVisible="false"
            isObjectSubtitleAlwaysVisible="false"
            objectTitle="{CompanyName}">						
        </uxap:ObjectPageHeader>
    </uxap:headerTitle>

    <uxap:headerContent>
        <layout:VerticalLayout>
            <ObjectAttribute title="Equipment ID" text="{BusinessPartnerID}"/>
            <ObjectAttribute title="Equipment External ID" text="{CompanyName}"/>
            <ObjectAttribute title="Description" text="{WebAddress}"/>
            <ObjectAttribute title="Source System" text="{EmailAddress}"/>
        </layout:VerticalLayout>	
        <layout:VerticalLayout>
            <ObjectAttribute title="Created By" text="{CreatedAt}"/>
            <ObjectAttribute title="Created At" text="{ChangedAt}"/>
            <ObjectAttribute title="Last Changed By" text="{WebAddress}"/>
            <ObjectAttribute title="Last Changed At" text="{EmailAddress}"/>
        </layout:VerticalLayout>
    </uxap:headerContent>
</uxap:ObjectPageLayout>
  1. The second column is in the top, looks strange. I think it should not in the same row with title.

first

I overwrite the css by

.sapUxAPObjectPageHeaderContent .sapUxAPObjectPageHeaderContentItem {
	vertical-align: bottom !important;
}

image

But I think it is not elegant, is there any better way?

  1. My another solution put the info in second column to a dialog using titleActive, but I found that there is only titleSelector in sap.uxap.ObjectPageHeader,

  2. Two column will change to one if the data is too long.

1column

I think it is cause by:

.sapUxAPObjectPageHeaderContent .sapUxAPObjectPageHeaderContentItem {
	margin-right: 2rem;
}

How to fix it ?

  1. If I set isObjectTitleAlwaysVisible="true", there will be two titles, I am not quite understand why I need two titles. What I want is hide the second title when `isObjectTitleAlwaysVisible=false", not hide the first.

image

TinaC avatar Aug 31 '17 07:08 TinaC

Thank you for sharing your findings. The question is forwarded internally for further investigation (ticket 1770354214). Updates will be posted in this GitHub issue.

JumpNRun avatar Sep 07 '17 13:09 JumpNRun

Hi Tina, you could try setting isObjectTitleAlwaysVisible="true" and showTitleInHeaderContent="false" in combination. Then it looks like in this: https://jsbin.com/juciyut/edit?html,output with the title at the top only and not doubled.

As per the other issue, the margin-right of 2rem is by design and the columns should go one below another if there is not enough space for the header to be responcible on devices. Hope this helps.

Regards, Mihail.

myordanov avatar Sep 28 '17 08:09 myordanov