sapui5

Difference Between this.getView().byId(), this.byId(), and sap.ui.getCore().byId()

那年仲夏 提交于 2019-12-18 07:13:21
问题 Can I know the difference and performance when I use var myControl = this.getView().byId("myIDhere"); var myControl = this.byId("myIDhere"); var myControl = sap.ui.getCore().byId("myIDhere"); Which of three is best to use to perform operations on control when I use XML views in UI5 apps? 回答1: this.getView().byId(...) is equivalent to this.byId(...) . Take a look at the source code to see what byId does: // sap.ui.core.mvc.Controller Controller.prototype.byId = function(sId) { return this

Initial loading of metadata fails due to “501 (Not Implemented)”

百般思念 提交于 2019-12-18 05:13:40
问题 I am trying to consume Northwind R/W OData service link: http://services.odata.org/V3/(S(frik5l2zde0sxh4jiifyhqo4))/OData/OData.svc/ as proxy/http/services.odata.org/V3/(S(frik5l2zde0sxh4jiifyhqo4))/OData/OData.svc which is working fine on local testing. Now when I want to ftp it to my domain, it's not working... NetworkError: 404 Not Found - http://{mydomain}/proxy/http/services.odata.org/V3/(S(frik5l2zde0sxh4jiifyhqo4))/OData/OData.svc/$metadata Using it without proxy like http://services

Passing Data from Master to Detail Page

青春壹個敷衍的年華 提交于 2019-12-17 19:45:35
问题 I watched some tutorials about navigation + passing data between views, but it doesn't work in my case. My goal is to achieve the follwing: On the MainPage the user can see a table with products (JSON file). (Works fine!) After pressing the "Details" button, the Details Page ("Form") is shown with all information about the selection. The navigation works perfectly and the Detail page is showing up, however the data binding doesnt seem to work (no data is displayed) My idea is to pass the JSON

How can I pass filter parameter in OData read method

半城伤御伤魂 提交于 2019-12-17 17:15:28
问题 I need to pass a parameter in my OData. The URL has to be like this: http://my_gateway_system:port/sap/opu/odata/sap/ZGW_TRANSF_APPROVAL_SRV_02/ztest_nameset('RUBENS') Below is my code: var sServiceUrl = "http://<my_gateway_system>:<port>/sap/opu/odata/sap/ZGW_TRANSF"; var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl, true, "username", "password"); var oJsonModel = new sap.ui.model.json.JSONModel(); oModel.read("/ztest_nameset('RUBENS')", null, null, true, function(oData, response)

How to handle the itemPress of sap.m.Table?

柔情痞子 提交于 2019-12-17 16:28:50
问题 I've written an XML view. Inside it there is a table: <Table xmlns="sap.m" id="myTable" select="" selectionChange="" swipe="" growingStarted="" growingFinished="" updateStarted="" updateFinished="" itemPress="console.log('clicked on item')" > <columns> <!-- sap.m.Column --> </columns> <items> <!-- sap.m.ListItemBase --> </items> </Table> I insert the row to the table using the onInit of the controller, but when I click on a row, the message is not shown. If I use console.log(tablePippo

Dynamic binding of table column and rows

て烟熏妆下的殇ゞ 提交于 2019-12-17 15:56:39
问题 I'm having troubles getting dynamic binding of both my table columns and rows to work. Suppose I have two models, one holding the table column info: var aColumnData = [ { columnId : "col1" }, { columnId : "col2" }, { columnId : "col3" }, { columnId : "col4" }, { columnId : "col5" } ]; and one with the data: var aData = [ { col1 : "Row 1 col 1", col2 : "Row 1 col 2", col3 : "Row 1 col 3", col4 : "Row 1 col 4", col5 : "Row 1 col 5" }, { col1 : "Row 2 col 1", col2 : "Row 2 col 2", col3 : "Row 2

Unable to get access Token linkedin Oauth

两盒软妹~` 提交于 2019-12-17 14:56:14
问题 I know some will put comment like this post is duplicate of so many questions, but I've tried many ways to achieve Access Token in linkedin Oauth. Explaining what i tried. 1) I'm following it's official doc's Linkedin Oauth2 2) I'm successfully getting Authorization code from step 2 and passing that code to step 3 for exchanging Auth code for getting Access Token. But i'm getting following error {"error_description":"missing required parameters, includes an invalid parameter value, parameter

Binding in Control with “class” Attribute

一曲冷凌霜 提交于 2019-12-17 09:54:39
问题 I want to handle the colors of the values in Text control (sap.m). If the value is "TRUE" , the color is green. Otherwise it will be red if the value is "FALSE" . <Text class="{= ${HintTable>IS_ENABLED} === 'TRUE' ? 'greenTextColor' : redTextColor'}" text="{HintTable>IS_ENABLED}" /> But it doesn't seem to be working. I mean, the class cannot receive the "greenTextColor" nor "redTextColor" . Did I make something wrong? 回答1: UI5 doesn't support binding for class in XML view directly as it's not

How to customise Shell container in SAPUI5

浪尽此生 提交于 2019-12-14 03:48:00
问题 I've a shell container and on big screens i want to utilize full with of screen. i want to cover full area. how i can customize it. 回答1: When working with a manifest.json file and the UI5-framework instantiates a shell control, do the following (appWidthLimited="false" cannot be used as you don't have a xml containing a shell 'tag'). manifest.json ... "sap.ui5": { "config": { "fullWidth": true }, ... ... 回答2: I assume you are using XML for your views. Add the following attribute

How to send email - SAPUI5

99封情书 提交于 2019-12-14 03:32:42
问题 I am trying to send sample email in SAPUI5. I have used sap.m.URLHelper.triggerEmail(["dummy@mail.com"], ["sample Subject"], ["Hi"]); . But it is not working. I have also tried using window.top.location = "mailto:" + email + "&subject=" + subject + "&body=" + message; . But no luck. 回答1: Try this: sap.m.URLHelper.triggerEmail("dummy@mail.com", "sample Subject", "Hi"); It should be without the [ ] because the parameters that triggerEmail expects are of type string 来源: https://stackoverflow.com