SAPUI5 ColumnListItem, icon need to be displayed on the left hand side - sapui5

I'm using table and using this property.
<ColumnListItem type="Detail" detailPress="onShowItemEditDialog">
I want the place the icon on the left side.
Because I use responsivePopover.The popover is opening on the right side.
I think I will change the table elements in this popover.
Or is there another way to change the elements of the table?
What can be done for table edit?
Please help.

you can build your own ListItem.
<List headerText="Custom Content" mode="Delete" items="{path: '/ProductCollection'}" >
<CustomListItem>
<HBox>
<core:Icon size="2rem" src="sap-icon://attachment-photo" class="sapUiSmallMarginBegin sapUiSmallMarginTopBottom" />
<VBox class="sapUiSmallMarginBegin sapUiSmallMarginTopBottom" >
<Link text="{Name}" target="{ProductPicUrl}" press="handlePress"/>
<Label text="{ProductId}"/>
</VBox>
</HBox>
</CustomListItem>
</List>
This example is taken from: https://openui5.hana.ondemand.com/#/sample/sap.m.sample.CustomListItem/code

A little tweak worked for me. Use the below code appropriately.
onAfterRendering: function() {
$( "thead .sapMListTblNavCol" ).insertAfter( "thead .sapMListTblHighlightCol" );
$( "tbody .sapMListTblNavCol" ).insertAfter( "tbody .sapMListTblHighlightCell" );
},

Related

Strange behavior of IconTabBar with GenericTile

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

How to implement info bar about filter setting in sap.m.table?

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.

UI5 - How to get Marquee Text

I was researching whether UI5 has any in-built functionality to provide marquee text but I cold not find any.
It seems that I may have to use jQuery or pure javascript to implement one. But if anyone already has any solution for this, can you please share it.
My XML View:
<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"controllerName="marquee.MarqueeDemo">
<Page title="Marquee Demo">
<content>
<FlexBox height="100%" width="100%">
<items>
<FlexBox direction="Column" justifyContent="Start" >
<Label id="idScrollText" design="Bold" text = "Hello World"></Label>
<Text text="How are you???"></Text>
</FlexBox>
</items>
</FlexBox>
</content>
</Page>
</mvc:View>
I would like ot have text of idScrollText to have scrolling effect like Marquee text of HTML.
WHat would be the optimal way to achieve that in Ui5?
Thanks !
I was able to achieve Marquee text using sap.ui.core.HTML
My View:
<FlexBox >
<core:HTML id = "idScrollText" width="100%"></core:HTML>
</FlexBox>
My Controller:
// Scrolling Text
var sPath = "Model/scrolltextdata.json";
$.ajax({
url: sPath,
success: function (result, status, xhr) {
var oDataText = result.Rowsets.Rowset[0].Row;
that.byId("idScrollText").setContent('<marquee style="font-size: 3.0rem;color: white;font-weight: bold">' + oDataText[0].InputText +'</marquee>');
}
});

How can I put icon and text in select items

I have an sap.m.Select control for a list of countries and I need to put flag near everyone. How can I do it? In XML, if it's possible.
Here is my XML code:
<m:Label text="{i18n>COUNTRY}" />
<m:Select width="100px"
fieldWidth="60%"
class="xcuiInputNoMargin"
enabled="{Edit>/EditOn}"
items="{countryList>/}"
>
<core:Item
key="{countryList>Country}"
text="{countryList>Country} - {countryList>Name}"
/>
</m:Select>
The sap.m.Select Object is restricted to display text (or Like #Jasper_07 said) icon only.
I think that the best solution for your problem is to use another object instead of your select. You can use Select Dialog and put inside whatever you want, like listItem with image.
This is an example:
<SelectDialog
noDataText="No Products Found"
title="Select Product"
search="handleSearch"
confirm="handleClose"
close="handleClose"
items="{
path: '/ProductCollection'
}" >
<StandardListItem
title="{Name}"
description="{ProductId}"
icon="{ProductPicUrl}"
iconDensityAware="false"
iconInset="false"
type="Active" />
</SelectDialog>
see link bellow
As of UI5 version 1.62, the following controls support displaying the icon on the left side.
sap.m.Select
sap.m.SelectList
And other controls based on the above mentioned ones, such as sap.m.ComboBox.
Here is an example:
sap.ui.getCore().attachInit(() => sap.ui.require([
"sap/ui/core/mvc/XMLView",
], XMLView => XMLView.create({
definition: `<mvc:View xmlns:mvc="sap.ui.core.mvc" height="100%">
<Select xmlns="sap.m" xmlns:core="sap.ui.core" class="sapUiTinyMargin">
<core:ListItem text="Paper plane" icon="sap-icon://paper-plane" />
<core:ListItem text="Stop Watch" icon="sap-icon://fob-watch" />
<core:ListItem text="Umbrella" icon="sap-icon://umbrella" />
</Select>
</mvc:View>`
}).then(view => view.placeAt("content"))));
<script id="sap-ui-bootstrap"
src="https://openui5nightly.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.ui.core, sap.m"
data-sap-ui-preload="async"
data-sap-ui-async="true"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatversion="edge"
data-sap-ui-xx-waitfortheme="true"
data-sap-ui-xx-xml-processing="sequential"
></script>
<body id="content" class="sapUiBody sapUiSizeCompact"></body>
Keep in mind to use sap.ui.ListItem as an aggregation child in this case, instead of sap.ui.core.Item.
Limitation
Currently, the icon property only allows resource paths from "sap-icon://*". I.e. images, that are not icons such as country flags, are not possible. A possible workaround would be to make use of emoji flags as additionalText.
Otherwise, I'd recommend to look for alternative controls as shmoolki suggested.
from the documentation of sap.m.Select
The URI to the icon that will be displayed only when using the
IconOnly type
seems limiting, but try
<m:Select
type="sap.m.SelectType.IconOnly"
icon="sap-icon://cart">
</m:Select>

Aspx grid view FileUpload

Bllow is my AspxGridview syntax
<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" KeyFieldName="Menu_ID"
OnCellEditorInitialize="ASPxGridView1_CellEditorInitialize" OnCustomUnboundColumnData="ASPxGridView1_CustomUnboundColumnData">
<Columns>
<dx:GridViewCommandColumn VisibleIndex="0">
<EditButton Visible="True">
</EditButton>
<NewButton Visible="True">
</NewButton>
<DeleteButton Visible="True">
</DeleteButton>
<CustomButtons>
<dx:GridViewCommandColumnCustomButton Text="Create a Copy" ID="Copy" />
</CustomButtons>
</dx:GridViewCommandColumn>
<dx:GridViewDataTextColumn Caption="Module_ID" FieldName="Module_ID" UnboundType="Integer"
VisibleIndex="1">
</dx:GridViewDataTextColumn>
<dx:GridViewDataButtonEditColumn Caption="Target_URL" FieldName="Target_URL" UnboundType="String"
VisibleIndex="2">
<PropertiesButtonEdit>
<Buttons>
<dx:EditButton Text=".." Width="5px">
</dx:EditButton>
</Buttons>
</PropertiesButtonEdit>
</dx:GridViewDataButtonEditColumn>
<dx:GridViewDataTextColumn Caption="Menu_ID" FieldName="Menu_ID" UnboundType="Integer"
VisibleIndex="3">
</dx:GridViewDataTextColumn>
</Columns>
</dx:ASPxGridView>
AspxGridview edit/insert mode Click on Target_URL column button i want to FileUpload .
Please take a look at the following example posted in our site:
http://www.devexpress.com/Support/Center/CodeCentral/ViewExample.aspx?exampleId=E95