I am using IconTabBar in my application and the text (heading for the tab) is not displaying fully. Half of the text gets cut.
<IconTabBar class="sapUiResponsiveContentPadding">
<items>
<IconTabFilter
icon="sap-icon://approvals"
text="Set Values for Mass Change" design="Horizontal"
>
<mvc:XMLView viewName="abc.view.selectionPage"/>
</IconTabFilter>
<IconTabSeparator icon="sap-icon://open-command-field"/>
</items>
</IconTabBar>
So here the text, which should be "Set Values for Mass Change", is output as "Set Values for Mass..."
The text is cut in half due to two properties set in the classes :
sapMITBHorizontalWrapper ( for the Wrapper Div) and
sapMITBHorizontal.sapMITBFilter>.sapMITBHorizontalWrapper>.sapMITBText ( Max-width for the displayed Text )
Here, max-width is set to 7.5rem and text-overflow is set to : ellipsis.
Somehow, its not possible to add a class to IconTabFilter (bad) but you can add class to IconTabBar. So, to solve this I've increased the max-width to 10rem. You can increase and decrease max-width to suit your requirements.
Below is the css code:
.myWidth .sapMITBHorizontalWrapper {
max-width: 10rem;
}
.myWidth .sapMITBHorizontal.sapMITBFilter>.sapMITBHorizontalWrapper>.sapMITBText {
max-width: 10rem;
}
View:
<IconTabBar class="sapUiResponsiveContentPadding myWidth">
<items>
<IconTabFilter id='myId' icon="sap-icon://approvals" class='' text="Set Values for Mass Change" design="Horizontal">
<!-- <mvc:XMLView viewName="abc.view.selectionPage"/> -->
</IconTabFilter>
<IconTabSeparator icon="sap-icon://open-command-field"/>
<IconTabFilter icon="sap-icon://approvals" class='' text="Short Text" design="Horizontal">
<!-- <mvc:XMLView viewName="abc.view.selectionPage"/> -->
</IconTabFilter>
<IconTabFilter icon="sap-icon://approvals" class='' text="Shorter" design="Horizontal">
<!-- <mvc:XMLView viewName="abc.view.selectionPage"/> -->
</IconTabFilter>
<IconTabFilter icon="sap-icon://approvals" class='' text="This is a Big text." design="Horizontal">
<!-- <mvc:XMLView viewName="abc.view.selectionPage"/> -->
</IconTabFilter>
<IconTabFilter icon="sap-icon://approvals" class='' text="Lil" design="Horizontal">
<!-- <mvc:XMLView viewName="abc.view.selectionPage"/> -->
</IconTabFilter>
</items>
</IconTabBar>
If the text becomes too long, consider to display texts only aligning with Fiori Design Guidelines:
If your labels get truncated, consider using shorter labels or text tabs (without icons), as text tabs cannot get truncated. [source]
Internally, the IconTabHeader (the header control for IconTabBar) then applies the style class sapMITBTextOnlysrc which excludes max-width.src
<IconTabBar>
<items>
<IconTabFilter text="products" count="20"/>
<IconTabFilter text="jkjlsdfjalkfak awfgvbf uwewrw fwkjfv dqw qlkwejqwklejdifsuvnvxdlcmeq" count="4"/>
<!-- ... -->
</items>
</IconTabBar>
Since the length is basically limitless, it's still recommended to ensure that the texts do not become too long.
try below
.sapMITBFilter .sapMITBText {
width: 10rem;
}
.sapMITBTab {
width: 10rem;
}
Related
Why does the XML tree on the picture looks like shown on the second picture? MessageStrip tries to get into the content area of IconTabBar even jumping over 4 elements and tiles get out by any means. There are no restrictions in documentation on what can placed in the IconTabBar or in the IconTabFilter. GenericTile is not a layout which is supposed to take the whole place on the screen. How to put tiles into the content of IconTabBar?
Here's the code of the view:
<mvc:View xmlns="sap.m" xmlns:mvc="sap.ui.core.mvc">
<IconTabBar id="idTopLevelIconTabBar" class="sapUiResponsiveContentPadding">
<items>
<IconTabFilter id="start" icon="sap-icon://hint">
<GenericTile class="sapUiMediumMarginBeginEnd sapUiLargeMarginTop tileLayout"
header="Sales Fulfillment Application Title"
subheader="Subtitle"
>
<TileContent unit="EUR" footer="Current Quarter">
<ImageContent src="sap-icon://home-share"/>
</TileContent>
</GenericTile>
<GenericTile class="sapUiMediumMarginBeginEnd sapUiLargeMarginTop tileLayout"
header="Manage Activity Master Data Type"
subheader="Subtitle"
>
<TileContent />
</GenericTile>
<GenericTile class="sapUiMediumMarginBeginEnd sapUiLargeMarginTop tileLayout"
header="Manage Activity Master Data Type With a Long Title Without an Icon"
subheader="Subtitle Launch Tile" mode="HeaderMode"
>
<TileContent unit="EUR" footer="Current Quarter" />
</GenericTile>
<GenericTile class="sapUiMediumMarginBeginEnd sapUiLargeMarginTop tileLayout"
header="Jessica D. Prince Senior Consultant"
subheader="Department"
>
<TileContent/>
</GenericTile>
<MessageStrip
type="Information"
showIcon="true"
text="Another IconTabFilter"
/>
</IconTabFilter>
<IconTabFilter id="layouts" icon="sap-icon://bookmark">
<!-- ... -->
</IconTabFilter>
</items>
</IconTabBar>
</mvc:View>
The solution was to remove my custom CSS (e.g. tileLayout) and to add any margin class (e.g. "sapUiLargeMarginTop") to the Message Strip so that Generic Tile fits inside an IconTabFilter.
The result
enableTickmarksis true for both slider controls, yet only one shows them?
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">
<Dialog title="{Title}" icon="sap-icon://create">
<beginButton>
<Button text="{i18n>cancel}" press="handleCloseCompetencySelection"/>
</beginButton>
<endButton>
<Button type="Accept" text="{i18n>submit}" press="handleSubmitCompetencySelection"/>
</endButton>
<content>
<FlexBox direction="Column" alignItems="Center" class="sapUiMediumMarginTopBottom">
<items>
<HBox><Label text="{i18n>required}: "/><Label id="RequiredProficiencyLabel" text="{ProfidrDescr}" design="Bold"/></HBox>
<Slider id="RequiredProficiencySlider" enabled="false" liveChange="onSliderChange" enableTickmarks="true" min="0" max="10"
class="sapUiSmallMarginBottom" width="400px"/>
</items>
</FlexBox>
<FlexBox direction="Column" alignItems="Center" class="sapUiMediumMarginTopBottom">
<items>
<HBox><Label text="{i18n>achieved}: "/><Label id="ProficiencyLabel" text="" design="Bold"/></HBox>
<Slider id="ProficiencySlider" liveChange="onSliderChange" enableTickmarks="true" min="0" max="10" class="sapUiSmallMarginBottom"
width="400px"/>
</items>
</FlexBox>
<MessageStrip text="{i18n>dragMessage}" type="Information" showIcon="true" class="sapUiMediumMargin"></MessageStrip>
</content>
</Dialog>
</core:FragmentDefinition>
There was a bug which is fixed as of version 1.52. The z-index of tickmarks was incorrectly set. Here you can see that the tickmarks are displayed correctly in Dialog: https://jsbin.com/ruqosej/edit?html,js,output
Funny story:
for "disabled" slider that tickmark looks bolder and perceptible than "enabled" one
the second slider shows the tickmarks, but you are not able to see them due to the very light grayscale color of the marks (to make sure that it is true, try to look at the sceen with different angle and you will see the tickmarks of the second slider; or use another display)
In fiori guideline of View Setting and Responsive Table, there is a info bar shows the filter setting. How to implement it?
It looks like a sap.m.MessageStrip, but there are only five kinds of MessageType in MessageStrip(Error, Information...), seems no such color suits for this bar. Should I overwrite this color?
In this Demo, message strip is put above the Table, but in design, it seems to put between table title and column, how to implement it?
I've tried this:
<Table>
<headerToolbar>
<Toolbar>
<Title id="tableHeader" text="title"/>
<!--BUTTONS-->
<VBox>
<MessageStrip
text="Filtered By:"
type="Information"
showCloseButton="true"
showIcon="false">
</MessageStrip>
</VBox>
</Toolbar>
</headerToolbar>
</Table>
But it looks like this:
It is called infoToolbar, not infoBar...
<Table>
<infoToolbar>
<Toolbar
active="true"
press="handleInfobarPress" >
<Label text="Filtered By: " />
<ToolbarSpacer />
<core:Icon
tooltip="Reset filter"
src="sap-icon://sys-cancel"
class="size2"
color="white"
press="onResetFilters">
</core:Icon>
</Toolbar>
</infoToolbar>
<headerToolbar>
<Toolbar>
<Title id="tableHeader" text="title"/>
<!--BUTTONS-->
</Toolbar>
</headerToolbar>
</Table>
infoToolbar is implemented in sap.m.ListBase as Aggregations: https://openui5.hana.ondemand.com/#/api/sap.m.ListBase
Both sap.m.List and sap.m.Table borrowed these aggregations/methods from sap.m.ListBase.
I am trying to show microchart in my tile container. But I don't know what is wrong with it. I have a single tile. which have some small charts like a progress bar, pie charts etc. none of my tile showing these. I've included the namespace for charts which is "xmlns:micro="sap.suite.ui.microchart"
<CustomTile >
<l:VerticalLayout class="sapUiContentPadding" width="100%">
<l:content>
<FlexBox height="70px" width="170px">
<micro:HarveyBallMicroChart isResponsive="true" total="100" totalScale="Mrd" showTotal="true" showFractions="true" app:name="harvey ball" press="press">
<micro:items>
<micro:HarveyBallMicroChartItem fraction="63.5" color="Good" fractionScale="Mrd" />
</micro:items>
</micro:HarveyBallMicroChart>
</FlexBox>
</l:content>
</l:VerticalLayout>
</CustomTile>
Put away:
<FlexBox height="70px" width="170px">
</FlexBox>
How to change the font size for sap.m.Label without CSS.
<Label text="NAME" />
Only way to change Label Font size is by using a custom CSS file.
Add a n ew folder under webapp and name it "css".
Add a file called "style.css" under the new folder.
Add the following style in style.css :
.myApp .smallLabel {
font-size: x-small;
}
Apply the style on your label :
<App class="myApp">
<pages>
<Page title="{i18n>homePageTitle}">
<content>
<Panel>
<content>
<Label text="{path: 'Recipes>Title'}" class="smallLabel"/>
</content>
</Panel>
</content>
</Page>
</pages>
</App>