UI5 Tiles to top of page - sapui5

I'm new to UI5 and try to display some Tiles on a page.
However, they appear in the center of the screen, and I would like to have it at the top.
Below it is a graph that now doesnt even appear on the page without scrolling.
How do get it to the top of the page and remove the bottom margins ?
View:
<TileContainer
id="container"
tiles="{deviceData>/d/results}">
<StandardTile
number="BBB"
numberUnit="CCC"
title="ZZZ"
info="XXX"
infoState="CCC" />
</TileContainer>
<l:C3Chart id="chart1" class="c3Chart" height="300px" width="100%" columns="{cols}" type="{timeseries}" />
</Page> </mvc:View>

Set the height of your tile container to 50% ( or whatever suits your requirements).
code:
<TileContainer tiles='{/}' height='50%'>
<tiles>
<StandardTile title='{title}'>
</StandardTile>
</tiles>
</TileContainer>

You likely dont need a TileContainer here (tile container is full screen component to use when you have an unknown -but important- number of tiles).
You should use a simpler container like an HBox here
<HBox
id="container"
items="{deviceData>/d/results}">
<StandardTile
number="BBB"
numberUnit="CCC"
title="ZZZ"
info="XXX"
infoState="CCC" />
</HBox>

Related

Scrolling Issue when Page placed within Page in SAPUI5

I have a requirement where I need to place an sap.m.Page within another sap.m.Page, which I am aware is not recommended. The issue I'm facing is that I'm trying to enable scrolling for only the outer page; but the scrolling does not dynamically increase as I expand content inside the inner page. There is a lot of vertical content inside the inner page and is not entirely visible since the scrolling does not increase along with the expanded panels.
Even this does not resolve my issue. Kindly assist.
SAPUI5 version: 1.38.37
Layout of the outer page:
<mvc:View ...>
<Page showHeader="false">
<content>
<IconTabBar>
<items>
<IconTabFilter>
<content>
<mvc:XMLView viewName="namespace.view.InnerView1" displayBlock="true"/>
</content>
</IconTabFilter>
<IconTabSeparator icon=""/>
.
//multiple IconTabFilters here
.
</items>
</IconTabBar>
</content>
</Page>
</mvc:View>
Layout of the inner page (InnerView1):
<mvc:View ...>
<Page showHeader="false" enableScrolling="false">
<content>
.
//multiple expandable/collapsible Panels here
.
</content>
<footer floatingFooter="false">
<Toolbar>
<ToolbarSpacer/>
.
//multiple Buttons here
.
</Toolbar>
</footer>
</Page>
</mvc:View>
The Panels in the inner page are initially collapsed but they are expandable. But if all Panels are expanded in the running app, then the last couple of Panels are not accessible with the scrolling. i.e. the scrollbar does not adjust as per the panels' height.
Try using:
enableScrolling="false" //for disabling
enableScrolling="true" //for enabling

How can a dialog determine the correct size for contained NavContainers?

I want to add a popup to my application that contains a NavContainer. I need this to switch between two different views within the popup later. Now the NavContainer seems to need a fixed value for height and width to display content. Otherwise the popup will only be displayed in the size of the header and footer line. I realized that I can fix the size, but that's not the sense of a responsive application.
My code looks like this without the fixed information:
<core:FragmentDefinition
xmlns="sap.m"
xmlns:core="sap.ui.core"
xmlns:l="sap.ui.layout"
xmlns:f="sap.ui.layout.form"
>
<Dialog id="genericDialog"
showHeader="false"
title="Detail View"
>
<NavContainer>
<Page id="page1">
<List items="{/avGenericSet}">
<CustomListItem class="sapUiResponsiveMargin">
<ObjectIdentifier title="{title}"/>
<Input value="{value}"/>
</CustomListItem>
</List>
</Page>
<Page id="page2">
<!-- ... -->
</Page>
</NavContainer>
<endButton>
<Button text="Close" press="closeGenericDialog"/>
</endButton>
</Dialog>
</core:FragmentDefinition>
The behavior can be observed in all popup types (Dialog, Popover, ResponsivePopover). Does any of you know a workaround or do I have to say goodbye to a "responsive" popup?
Try with contentHeight="100%" (and contentWidth if required) from the Dialog. Here is an example: https://embed.plnkr.co/7nimup1UMGsifeDQ?show=view/fragment/Dialog.fragment.xml,preview

SAP UI5 Application - Scrollbar issues

In SAP UI5 application, every table has its own scrollbar. There is one page level scrollbar as well. Problem is, to see all the rows of the table I have to use, both the scrollbars. For example, if I am scrolling the table, once it reaches the bottom (of the page not table), scroll disappears. Now to see remaining of the rows, I have to use Page scrollbar and move it down. Then again I can see table scroll and can move below. This means i have to use 2 scrollbars for viewing the rows. Any way to avoid this?
Second issue: If I don't use tag proper page level scroll does not appear. A very long scroll thumb appears (for example if I use semantic page tag as shown below, the scroll thumb is as good as body in length, with very little area to move as track)
ABC.xml
<mvc:View controllerName="com.ABC" xmlns:layout="sap.ui.layout" xmlns:core="sap.ui.core"
xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:semantic="sap.m.semantic">
//Here instead of semantic page if I use
// <Page class="sapUiNoMargin maxPage" showHeader="false"> it works fine
with proper page scroll of nice thumb length
<semantic:SemanticPage busy="{sharedApp>/oBusy/busy}" busyIndicatorDelay="{sharedApp/oBusy/delay}" id="page" showSubHeader="false">
<semantic:content>
<core:Fragment id="ordersGrowlNotifier" fragmentName="com.ASD" type="XML"/>
<IconTabBar id="order-tabs" select="onTabChangeEvent" expandable="false" class="tabs">
<items>
<IconTabFilter text="Order" key="cart_tab">
<content>
<VBox>
<items>
<core:Fragment fragmentName="com.Order" type="XML"/>
</items>
</VBox>
</content>
</IconTabFilter>
<IconTabFilter id="orderdetails-tab-track" key="track_tab" text="Track" visible="{orderMenu>/TrackVisible}" >
<content>
<VBox>
<items>
<core:Fragment fragmentName="com.XYZ" type="XML"/>
</items>
</VBox>
</content>
</IconTabFilter>
</items>
</IconTabBar>
</semantic:content>
</semantic:SemanticPage>
</mvc:View>

Line break in XMLView UI5

How can I set a line break between two controls?
I want to display one by one in vertical manner.
You can use a flex box control: either <VBox> or <HBox>.
<VBox xmlns="sap.m" wrap="Wrap" renderType="Bare">
<!-- ... -->
</VBox>
You don't really use linebreaks but layout controls.
If you want to have an element below another element, put both of them in a vertical layout.
https://sapui5.hana.ondemand.com/explored.html#/entity/sap.ui.layout.VerticalLayout/samples
<l:VerticalLayout>
<Input placeholder="UserID" />
<Input placeholder="Password" type="Password" />
</l:VerticalLayout>
Don't forget to include the namespace: xmlns:l="sap.ui.layout"
You can also nest different layouts: Outer layout is vertical, and each row of the vertical layout can be a horizontal layout where items are placed next to each other.
Edit: This also works in IE9. VBox unfortunately does not work in IE9.

How can I show tile horizantally in Sapui5?

How can I show tile horizontally in Sapui5. I am using tile container. This container scrolling right but I want scroll down side.
So, if the TileContainer does not fulfill your needs, then why not use the ScrollContainer instead?
<ScrollContainer
height="100%"
width="100%"
vertical="true"
content="{
path: '/TileCollection'
}">
<StandardTile
icon="sap-icon://{icon}"
type="{type}"
number="{number}"
numberUnit="{numberUnit}"
title="{title}"
info="{info}"
infoState="{infoState}"
press="handlePress"/>
</ScrollContainer>