sapui5

What's the usage of setBindingContext() and the difference from element binding?

馋奶兔 提交于 2019-12-21 05:38:11
问题 In the 1.5.2.3 Defining a Binding Path section of OpenUI5 demokit: A context exists either for each entry of the aggregation in case of aggregation binding or can be set explicitly for a control by using the setBindingContext method. In the 1.5.3.3 Element Binding section of OpenUI5 demokit: Element binding allows to bind elements to a specific object in the model data, which will create a binding context and allow relative binding within the control and all of its children. It seems to me

SAPUI5 Wait for an Deferred-Object // wait for .done() function

[亡魂溺海] 提交于 2019-12-20 07:20:32
问题 I know there are several threads on this, but I think in SAPUI5 context no thread answers this general topic on deferred/sync calls in SAPUI5. In My Controller I got : test : function() { var dfd = $.Deferred(); var sServiceUrl = '/sap/opu/odata/sap/xyz/MySet?$format=json'; var post = $.ajax({ url: sServiceUrl, type: "GET" }); post.done(function(data){ console.log(data); dfd.resolve(); }); post.fail(function(){ console.log("Error loading: " + sServiceUrl); dfd.reject(); }); return dfd.promise

SAPUI5 Smart Table : How to Inject my own column into smart Table, Default columns, Define formatters, and Define aggregated columns

独自空忆成欢 提交于 2019-12-20 05:44:37
问题 I am Using Smart Table. i want to know the following regarding this, How Make some columns visible by default How can we inject our own columns into smart table, like if we want to display the icon based on the gender(male or female). How can we set aggregated columns like Name (FirstName + LastName). How to define the sorting and filtering on Aggregated Columns. 回答1: XML View <core:View xmlns:core="sap.ui.core" xmlns="sap.m" xmlns:smartFilterBar="sap.ui.comp.smartfilterbar" xmlns:smartTable=

How to get selectedKey of sap.m.Select from outside?

风流意气都作罢 提交于 2019-12-20 05:24:20
问题 Having this select control: new Select("id", { items: { path: "/cards", template: new ListItem({ key: "{Kunnr}", text: "{Descrip}" }), }, }); I need it be able to get the selected key of it, but not in the change event. I need it from outside (another function). I have tried using the ID but I just get undefined as result. 回答1: There is a some information missing from your question, mostly around how oSelectMarca is added to your view. This makes a difference in how it's made available in

How to get selectedKey of sap.m.Select from outside?

纵饮孤独 提交于 2019-12-20 05:24:09
问题 Having this select control: new Select("id", { items: { path: "/cards", template: new ListItem({ key: "{Kunnr}", text: "{Descrip}" }), }, }); I need it be able to get the selected key of it, but not in the change event. I need it from outside (another function). I have tried using the ID but I just get undefined as result. 回答1: There is a some information missing from your question, mostly around how oSelectMarca is added to your view. This makes a difference in how it's made available in

Is it really required to listen for global init event using “attachInit” function?

岁酱吖の 提交于 2019-12-20 04:23:14
问题 I read it in many articles that, "it is a good practice to listen for global init event in order to trigger your application logic only after the event has been fired". But I tried to do otherwise still no problem occurs. When I check the network tab all, irrespective of the placement of the code, the core libraries are loaded first. Then the code dependent on libraries is loaded. I tried searching for my answer but couldn't get a clear answer. I tried to check it using a sample code I wrote.

SAPUI5 routing throws error “Control (ID of an App control) does not has an aggregation called pages”

…衆ロ難τιáo~ 提交于 2019-12-20 04:18:56
问题 What I have in my Component.js are these routes: routes: [ { pattern: "", name: "menu", view: "Menu", targetAggregation: "pages", targetControl: "idAppControl", subroutes: [ { pattern: "Reports", name: "reports", view: "SplitContainer", targetAggregation: "pages", targetControl: "idAppControl", clearTarget: true } ] } ] When I try to access the subroute (URL/#/Reports) the application throws (Chrome): Control idAppControl does not has an aggregation called pages - This is confusing due to the

SAPUI5 Search Field Suggestion Autocomplete

元气小坏坏 提交于 2019-12-20 03:17:18
问题 I am developing an SAPUI5 application. What I want to achieve is to have a suggestion list autocomplete in my search field. For example when I type "app", I will list suggestion of "apple, application". The list of suggestion is retrieving from xsodata web services. I am using enableSuggestions and suggestionItems in my SAPUI5, but it does not works at all. The following is my sample code. view.xml <headerToolbar> <Toolbar> <Title text="Product Module"/> <ToolbarSpacer/> <SearchField width=

Aggregation in SAP UI5

倾然丶 夕夏残阳落幕 提交于 2019-12-19 12:46:29
问题 Can anybody explain what exactly Aggregation means in SAP UI5 ? I am trying to make an app with two views and i want to navigate from one view to another and vice -versa. So , the APP control is having aggregation , so i am confused what Aggregation is ? 回答1: Basic definition of «aggregation» from Glossary: An aggregation (in the context of UI5) is a special relation between two UI element types. It is used to define the parent-child relationship [...]. The parent end of the aggregation has

SAPUI5 create JSON for TreeTable / empty rows

て烟熏妆下的殇ゞ 提交于 2019-12-19 10:52:05
问题 I want to create a SAPUI TreeTable from a JSON request, currently my output looks like this (as you can see, every node contains an empty row -> I do not know where this is coming from and I do not want to have these empty rows): My Table definition: //Create an instance of the table control var oTreeTable = new sap.ui.table.TreeTable({ columns: [ new sap.ui.table.Column({ label : new sap.ui.commons.Label({ text : "", }), template : new sap.ui.commons.TextView({ text : "{Title}", textAlign :