sapui5

i18n model doesn't work properly

我是研究僧i 提交于 2019-12-24 16:30:45
问题 I have a code that checks a response from a server and shows message box according to the information received. I have these messages in 2 languages (user selects a language during login). Here is example: if(sResponse == 'IDfail'){ sap.m.MessageBox.alert ("{i18nResourceModel>idnotnine}", {icon: sap.m.MessageBox.Icon.ERROR, title: "{i18nResourceModel>error}"} ); } Here is i18n model declaration (it is declared before I use the model, of course): var oResourceModel = new sap.ui.model.resource

How to load a external html file?

邮差的信 提交于 2019-12-24 16:13:12
问题 I just want to load a .html file into a JS view in my UI5 Application. This file is an external page that contains some charts.. I'm trying many things, but no success.. Thank you very much if anyone could help me on that. 回答1: What were those "many things" you tried? The general approach is to embed the other HTML page as an iframe, using the sap.ui.core.HTML control, see this example: http://jsbin.com/dutuparedeyu/1/edit?html,output new sap.ui.core.HTML({ preferDOM: true, content: "<iframe

Use custom global function in Expression Binding

℡╲_俬逩灬. 提交于 2019-12-24 14:46:20
问题 I see how to use expression binding. https://sapui5.netweaver.ondemand.com/docs/guide/daf6852a04b44d118963968a1239d2c0.html I can use a small range of function call ( You can use functions that are available via global symbols, such as Math.max(...) or isNaN(...). ) I have my custom function isVisible(sParam) but I want write the sParam value directly into the xml code ( sParams is never in the model ), something like this visible='{=isVisible('01 03 05 06')}' My idea is to define isVisible

How to set sorter of a List in Controller in SAPUI5?

若如初见. 提交于 2019-12-24 14:09:33
问题 This is basically a workaround trial for the question here : "How to use custom sorter in XML views" Since currently it is not possible to use custom sorters in XML views, I thought maybe it is possible to set the sorter in the controller. How you do that with JS view is like this: var oTemplate = ... // irrelevant var oList = new sap.m.List({ id: this.createId("someList"), items: { path: "/list", template: oTemplate, sorter: foo.bar.CustomSorter } }); And when I want to convert that to and

Performing OData methods with Edm.DateTime as part of primary keys

ぃ、小莉子 提交于 2019-12-24 13:33:45
问题 I have the problem, that I want to update a table via HTTP-request. But I always get an error-message on the Edm.DateTime attributes in the table. Error: Invalid URI-Segment '00:00',ValdTo=datetime'2019-04-03T00:00:00')'"} Even the value is already converted to Edm.DateTime. valdfrom_edit = encodeURI(sap.ui.model.odata.ODataUtils.formatValue(new Date(values.ValdFrom), "Edm.DateTime")); var update = "/ZSCORDERINGSet(Mandt='010',Vkorg='" + vkorg_Edit + "',ZzscSpSas='" + suppl_edit + "',ValdFrom

SAPUI5 IconTabBar/IconTabFilter: Trigger Icon Tab Select

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 13:09:45
问题 I have an XML view which I am using to display an IconTabBar. On the user selecting one of these "IconTab's" I would like to trigger a method in the controller js file. I have the following code for one of the IconTab definitions. <IconTabFilter text="Data" icon="sap-icon://documents" press="onData"> <content press="onData" id="data"> <cmn:Tree nodes="{/aRoot}"> <cmn:TreeNode text="{@name} TagNameHere?"></cmn:TreeNode> </cmn:Tree> </content> </IconTabFilter> I was assuming the press="onData"

UI5 StandardListItem DetailAndActive change Icon

99封情书 提交于 2019-12-24 10:56:03
问题 I would like to change the standard "pen" icon of the StandardListItem of type DetailAndActive . Is there a way to do so? my XML so far: <List id="master1List" items="{/path}" mode="{device>/listMode}" select="onSelect" itemPress="showDetail" growing="true" growingScrollToLoad="true"> <items> <StandardListItem type="DetailAndActive" activeIcon="sap-icon://message-information" id="master1ListItem" press="onSelect" title="{title}"> </StandardListItem> </items> </List> As far as I know there are

Using HTML5 CSS in Eclipse

我只是一个虾纸丫 提交于 2019-12-24 08:26:50
问题 I am beginner in SAPUI5. I am building SAPUI5 application with HTML5 in Eclipse. In index.html page I am creating a html5 page, I have created css folder under WebContent. In index.html I added to refer css file. But properties in css are not affecting in html page. Do I need to add any other code to refer CSS file. Css: @CHARSET "ISO-8859-1"; body { background-image: "image/splash-sunrise.jpg"; background-size: 100px 100px; background-repeat:no-repeat; } 回答1: To use CSS within the SAPUI5

Focus handling in ResponsivePopover / Dialog / Popover

╄→尐↘猪︶ㄣ 提交于 2019-12-24 07:59:45
问题 I struggle to understand the automatic focus handling in SAPUI5 and how to change its default behavior: Let's say I have a ResponsivePopover with a SearchField in it. When I open the popover, the SearchField gets focused automatically. However when there is an <endButton> aggregation with a Button in it, it gets the focus instead. Try it out here: JSbin: Focus in ResponsivePopover function showPopover(oEvent) { var oRespPopover = new ResponsivePopover({ showHeader: true, title: "title",

Creating a new complex entry on OData [sapui]

被刻印的时光 ゝ 提交于 2019-12-24 07:49:22
问题 I have this complex OData model: <EntityType Name="ApprovalsRequest"> <Key> <PropertyRef Name="IdUser"/> <PropertyRef Name="RequestId"/> </Key> <Property Name="ApprovalTime" Type="Edm.DateTime" Nullable="true"/> <Property Name="IdUser" Type="Edm.Int32" Nullable="false"/> <Property Name="RequestId" Type="Edm.Int32" Nullable="false"/> <Property Name="Request" Type="Edm.Int32" Nullable="true"/> <Property Name="Status" Type="Edm.String"/> <Property Name="User" Type="Edm.Int32" Nullable="true"/>