sapui5

Preventing router from navigating after hash changing

强颜欢笑 提交于 2020-01-05 20:30:05
问题 I need to prevent router to be navigated to another page (which is done by changing the hash) if some changes are made. Tried with HashChanger but it just fires 'hashChange' events with no way to prevent it from bubbling. The answer can be inside of JS-Signals library but it's unavailabale directly for user-created SAP components. 回答1: There is a stop function on the router https://sapui5.hana.ondemand.com/#/api/sap.ui.core.routing.Router/methods/stop if you call it, the router will stop

sapui5 JS in controller table is not binding

依然范特西╮ 提交于 2020-01-05 07:32:30
问题 Im trying to create search help using Odata service but my table is showing as undefined in controller, here is my code plz help index.html <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta charset="UTF-8"> <title>search_help</title> <script id="sap-ui-bootstrap" src="../../resources/sap-ui-core.js" data-sap-ui-libs="sap.m,sap.ui.commons,sap.ui.table,sap.ui.ux3" data-sap-ui-theme="sap_belize" data-sap-ui-compatVersion="edge" data-sap-ui-resourceroots='{"search_help": ""}'>

how to load external libraries into an SAP UI5 view?

北慕城南 提交于 2020-01-05 07:31:59
问题 In SAP UI5 I can load local files this way: jQuery.sap.require("util.someFile"); But is it possible to load external libraries when required in some view using the above command or a similar approach? Ideally, I am looking for something like: theLoadingCommand("some_url"); Thanks 回答1: Basically it is possible to register a module path to some URL. jQuery.sap.registerModulePath('external.library', 'http://....'); //not working There is only one problem with that. UI5 loads the resources via

unable to apply search on multiple fields in sapui5

我的未来我决定 提交于 2020-01-05 06:50:54
问题 I want to apply search on multiple fields in sapui5 on 'Name' and 'Phone No' fields. I am able to apply single field search on 'Name' field but not on 'Phone No' field. When trying to implement on 'Phone No.' field, it doesn't work. Also, it doesn't show any errors. Please see the code below and help. Contacts.controller.js : sap.ui.define([ "sap/ui/core/mvc/Controller", "sap/ui/model/json/JSONModel", "sap/ui/model/Filter", "sap/ui/model/FilterOperator" ], function(Controller,JSONModel,Filter

Eslint : sap-no-ui5-prop-warning

巧了我就是萌 提交于 2020-01-05 06:33:35
问题 I want to remove the ESLint warnings. I got sap-no-ui5-prop-warning because I used this.getModel().oData["ProductSet('" + sId+ "')"].Matricule . But when I use the function getData() , it returns null. Do you have a suggestion how to fix this? 回答1: Look at the docs. It's simple. /* eslint-disable sap-no-ui5base-prop */ ...some code false positives /* eslint-enable sap-no-ui5base-prop */ Btw getData() for ODataModel is deprecated. You can use getProperty("/") instead. It'll give you the root

Eslint : sap-no-ui5-prop-warning

此生再无相见时 提交于 2020-01-05 06:32:25
问题 I want to remove the ESLint warnings. I got sap-no-ui5-prop-warning because I used this.getModel().oData["ProductSet('" + sId+ "')"].Matricule . But when I use the function getData() , it returns null. Do you have a suggestion how to fix this? 回答1: Look at the docs. It's simple. /* eslint-disable sap-no-ui5base-prop */ ...some code false positives /* eslint-enable sap-no-ui5base-prop */ Btw getData() for ODataModel is deprecated. You can use getProperty("/") instead. It'll give you the root

Eslint : sap-no-ui5-prop-warning

谁说胖子不能爱 提交于 2020-01-05 06:32:00
问题 I want to remove the ESLint warnings. I got sap-no-ui5-prop-warning because I used this.getModel().oData["ProductSet('" + sId+ "')"].Matricule . But when I use the function getData() , it returns null. Do you have a suggestion how to fix this? 回答1: Look at the docs. It's simple. /* eslint-disable sap-no-ui5base-prop */ ...some code false positives /* eslint-enable sap-no-ui5base-prop */ Btw getData() for ODataModel is deprecated. You can use getProperty("/") instead. It'll give you the root

SAPUI5 this.getView(…).byId(…).setValue is not a function

别来无恙 提交于 2020-01-05 05:39:08
问题 I'm new to SAPUI5 and I'm trying to set a value into a label in my view via my controller. View1.controller.js onInit: function() { var currentTime = this.whatsTheTime(); var currentDate = this.whatsTheDate(); this.getView().byId("timeDisplay").setValue(currentTime); this.getView().byId("dateDisplay").setValue(currentDate); this.repeat(function() { currentTime = this.whatsTheTime(); currentDate = this.whatsTheDate(); this.getView().byId("timeDisplay").setText(currentTime); this.getView().byId

Reset all screen's control values

早过忘川 提交于 2020-01-04 14:30:59
问题 I have an "Add New…" screen with multiple sap.m.Input fields. Everything is working. I submit the form and the values are stored in the DB. But once I re-open this "Add New…" screen, I get the form with previously entered values. Currently, I can solve the issue iterating over all sap.m.Input fields with sap.ui.core.Element , resetting the values: Element.registry.forEach(el => { if (el.isA("sap.m.Input") && el.sId.includes(inputFieldsMask)) { sap.ui.getCore().byId(el.sId).setValue(""); } });

SAPUI5 Data Binding on SimpleForm

感情迁移 提交于 2020-01-04 05:39:09
问题 I am having issues trying to bind data on a simple form. I am using a mock server and have successfully bind data to a list/table My manifest.json looks like this "mock": { "dataSource": "mainService" } My mockdata(UserDetailsSet.json) looks like this [{ "ID_PassNum": "cu001", "Title": "Mr", "Name": "Don", "Surname": "Ownery", "ResType": "SA", "Country": "South Africa" }] My SimpleForm fields looks like this <Label text="Name" /> <Input value="{mock>/UserDetailsSet/0/Name}" /> <Label text=