sapui5

Create Country List from JSON

笑着哭i 提交于 2019-12-14 03:12:01
问题 I am trying to create a combo box with a list of countries in SAP UI5. I have created a combo box and have created dynamic list of some countries, but to create more than 100 countries, the only easy way is to create a JSON file of countries and then populate in Controller.js. I tried to create a JSON file but I am unsure whether I have to store it under model folder or root . What changes do I have to make in my XML view and controller, and where should I attach countries.json file? 回答1: You

Setting constraints to sap.m.DatePicker

断了今生、忘了曾经 提交于 2019-12-14 02:29:31
问题 How do I get my DatePicker to implement my minimum and maximum date constraint? If an unallowed date is chosen, I preferably do not even want it to trigger a change event, or at least revert the date to one that is allowed. I use 2-way binding, so if I change the date, the date in my model also changes. var oData = { "minimumConstraint" : "2010-01-01", "maximumConstraint" : "2020-01-01", "displayDate" : "2015-01-01" }; var oModel = new sap.ui.model.json.JSONModel(oData); sap.ui.getCore()

How to create a Smart Field control with ValueHelp feld

落爺英雄遲暮 提交于 2019-12-13 22:41:39
问题 I need to implement a Smart Field control with Value Help in my form. I am getting json response from ODATA service. And I am setting it to a JSONModel. I have tried a sample code refering this link but I don't know how to bindElement. Please refer this JsBin 回答1: SmartControls rely on OData! However, you are using a JSONModel! Also, as @matbtt mentioned you are binding a single field to an array, but you should do it the way he mentioned above... This jsbin is the correction but still only

How to have control instance as “this” in formatter?

99封情书 提交于 2019-12-13 22:07:36
问题 I am using SAP UI5 1.52. My formatter file is a separate file and loaded in the controller. But logging this in the formatter returns view instance rather than control instance. I have referred this question before and tried using absolute path and changed the way object is returned in formatter. It throws an error saying function not found. 回答1: UI5 1.69+ View <MyControl xmlns:core="sap.ui.core" core:require="{ format: 'demo/model/format' }" property="{ path: '...', formatter: 'format' }" />

Animation in SAPUI5

╄→гoц情女王★ 提交于 2019-12-13 19:37:59
问题 I have two matrix layout. The first one contains seven images placed like a grid. How can we arrange all the images vertically in the second layout with animation? -Thanks 回答1: If you are able to 1) detect the location of your target matrixlayoutrowcells, 2) to detach the content of the source cell and 3) attach it to the target cell, than it's nothing more than just incorporating some CSS animations ;-) See this example of a moving sap.ui.commons.Image : http://jsbin.com/jafuk/1/edit 来源:

SAPUI5 routing Single Master to Multiple Details

妖精的绣舞 提交于 2019-12-13 19:15:54
问题 I'm Trying navigate from Master view to Multiple detail views. But I don't know how do it in component.js, all the samples are simple detail views. I can Navigate to all views but I can't get the binding from odata, only the last detail view in routing work's correctly. component.js code: routing : { config : { routerClass : ZPPS.MyRouter, viewType : "XML", viewPath : "ZPPS.view", targetAggregation : "detailPages", clearTarget : false }, routes : [ { pattern : "", name : "main", view :

SAPUI5 OData - How to create new entry with association to existing entity?

南楼画角 提交于 2019-12-13 17:18:14
问题 I am currently using SAPUI5/OpenUI5 to consume and modify OData Services. I want to create a new product entry over an HTTP POST Request and have problems to properly config the associations to a category. For developing reasons I am using a reference OData Service with this metadata. The Product already has the NavigationProperty to the right Category EntrySet. <NavigationProperty Name="Category" Relationship="ODataDemo.Product_Category_Category_Products" FromRole="Product_Category" ToRole=

OData vs XSJS in SAP Hana Development

天大地大妈咪最大 提交于 2019-12-13 16:25:03
问题 I am developing an application using SAP Hana studio and I am confused on why I would use XSODATA and why I would use XSJS. Why can't I just use a XSODATA file to perform all of my database transactions? I get XSJS is server-side, but if I am doing basic CRUD operations could I just use XSODATA? A related question, would the XSODATA file be create in SAP Hana studio and work fine from there? The reason I ask is because before I had to create a service in Gateway service builder and provide

Display Nested JSON data in SAPUI5 (sap.m Table)

女生的网名这么多〃 提交于 2019-12-13 14:10:20
问题 i currently work with sap.m and i have a problem with binding data of a nested json to a sap.m table . This is the content of my json file: { "courses": [ { "req_id": "1", "name" : "ABAP OO Basics", "start" : "20-08-2014", "end" : "22-08-2014", "starttime": "10:00:00", "endtime": "16:00:00", "status": "Booked", "room": "Room CDE", "adress" : "Adress No.1", "street": "Street No.1", "zip_code": "74892142578485", "city": "City No.1", "country": "Country No.1", "phone": "0595726764675435497436497

Formatter Function Not Found - SAP UI5 [closed]

北战南征 提交于 2019-12-13 11:22:02
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I am facing an issue in formatter. I have a function inside a formatter. When I call the function, it says " .formatter.checkFunc() not found.!. I have included all necessary files in the controller. But not able to find the cause of the issue. View : <Text text="{parts: ['value'], formatter: '.formatter.checkFunc