FAQ Database Discussion Community


Change defaultDate after Calendar is created (fullcalendar)

javascript,jquery,calendar,fullcalendar,sapui5
I´m integrating the JavaScript Calendar, called fullcalendar ( fullcalendar page) into my SAPUI5 Webpage. The calendar runs in a specific tab. I now want to change the default date after the calendar was created, to display a specific month. setCalendar : function () { var that = this; if(!this.todayDate) {...

Sapui5 column of links

sapui5
I have a column of links. I want each link to display different information in a popup box when clicked. How can I accomplish this? Here is the column I have created: oControl = new sap.m.Link({ text: "{userEmails}" }); oTable.addColumn(new sap.ui.table.Column("userEmails", { label: new sap.m.Label({ text: "User Emails" }), template:...

How can I filter through a table using a ComboBox?

combobox,sapui5,sapui
The only thing I need to know is if I can create a value for an item in the ComboBox, then I think I will be able to accomplish the task at hand. Would I do something like: var oItem1 = new sap.ui.core.ListItem("lab", { text: 'Lab', value: 'Lab' }); var...

Accessing JSON object in SAPUI5 via xsodata

javascript,json,odata,sapui5
I try to access the value of my json objects in sap ui5, but the getproperty function cannot access the required data. But, at first, I have created a xsodata file with some service definitions, e.g. "CUSTOMER_ATTR_G3" as "Customers"; Then I try to get these data in view.js file with...

can not create icon in sap.m.page

sapui5,sapui
How come I cant create icon in my page? it is only one app and one page but still doesnt work. createContent : function(oController) { var app = new sap.m.App(); var statusPage = sap.m.Page("statusPage",{ title : "some app", }); statusPage.setIcon("http://www.sap.com/global/ui/images/global/sap-logo.png"); app.addPage(statusPage); return app; } ...

Image Buttons onchange when clicked in SAPUI5?

javascript,jquery,html5-canvas,sapui5
Can any one of you help me in knowing how to change the image button when clicked, should change to other image button. Here is my code.. var offButton = new sap.ui.commons.Button({ id : "offIcon", icon : "img/off.png" , press :function(e) { alert("clicked"); var noButton = new sap.ui.commons.Button({ id:"noIcon", icon...

SAPUI5 switch focus

javascript,focus,sapui5
In my code I have textarea and dropdown input with binded model data. When changing dropdown value textarea gets new value and changes its content. Problem is that I would like to focus to switch from dropdown to textarea. Currently I have modified liveChange event like this: flavorScriptsDDLB.liveChange = function(ev)...

SAP UI5 Demo Toolkit Source Code

sap,sapui5
I'm new to SAP and SAPUI5 in particular and trying to improve my skills in this domain. I'm looking for some demo apps built using SAPUI5, and found some in the Demo kit (https://sapui5.netweaver.ondemand.com/sdk/#demoapps.html) However I can't find the source code for these apps, neither for other non-trivial demos. Even...

Icon in table incompatible with mergeDuplicates=“true”

sapui5,sapui,openui5
I have a Table and I want to merge duplicates in the first column: <Column mergeDuplicates="true"> <Text text="Society"/> </Column> <Column> <Text text="Ref2"/> </Column> ... I want to have a complex element in the first column: An icon that shows the flag of society. <items> <ColumnListItem> <cells> <StandardListItem title="{model>society/description}" icon="{path: 'model>society/code',...

Routing in SAPUI5: How to implement passing of URL? Model data not initialy loaded

url-routing,sapui5,openui5
My goal is to write a SAPUI5 Fiori app with routing support. One mail goal is to have passable URLs. For example in an E-Mail like "please approve this: link". The link is an URL matched by my rounting config, e.g.index.html#/applicants/8. I use a typical sap.m.SplitApp kind of application. Clicking...

Performing animation in UI5

css-animations,sapui5,openui5
I am trying to animate an image(id is register1) in ui5. I have tried using using the animate feature of jQuery. But it does not seem to work. var a = this.getView().byId("register1"); a.animate.css({opacity: 0.0, visibility: "visible"}).animate({opacity: 1.0}); a.animate.css({opacity: 1.0, visibility: "visible"}).animate({opacity: 0.0}); a.animate({visible:'true'},"slow"); a.animate({visible:'false'},"slow"); a.animate({visible:'true'},"slow"); ...

How create sorters and Filters of Row Repeater in xml view of SAP UI5

sap,sapui5
I am trying to create Sorters and Filters of Row Repeater Element in Xml View of SAP UI5. I tried to create by using the Javascript View But no Luck. Please can any one help me to write Sorters and Filters of Row Repeater in XML View. <c:filters> <c:RowRepeaterFilter id="filter1"...

“%” is getting URI decoded while everyhting else not

javascript,uri,sapui5,openui5,uriencoding
I have a strange UI5 problem. I create a string from a control's binding context which looks like: Entity('Element%3AInfo%2CID') Just for info, it looks like this decoded: Entity('Element:Info,ID') However, I get this String from the following method chain: oItem.getBindingContext().getPath().substr(1) So, the whole (pretty basic) "navigate to" block looks like this:...

SAPUI5 - custom searchfield properties

javascript,xml,sap,sapui5,sap-fiori
I have created a search-field in SAPUI5 using XML. The search field works properly but whenever I enter a search value which is not valid, it returns "No Data", which is correct. I want to edit the "No Data" phrase and customize it to my own phrase like this: "No...

SAPUI5 table formatting

css,sapui5,sapui
I am quite new in CSS and SAPUI5. Although making good progress, I am having a hard time applying style options to SAPUI5 tables. My action is aiming on formating a specific table having id tbl1. In index.html, I gave custom css style definition like: #tbl1{ font-size: 200%; font-weight: bold;...

SAPUI5 Component Metadata rootView Parameter for JSONView

json,components,sapui5,rootview,openui5
Has anyone been able to specify a JSON view in the rootView parameter in the metadata of SAPUI5(or OPENUI5) component. My ultimate goal is to implement something similiar to this "Best Practices" demo app using JSON views. In the "Application Best Practices" UI5 demo app, the component.js file contains a...

Event triggers by itself

javascript,sapui5
I have no idea why function wich should run only when button is pressed runs by herself. Here is my button declaration: var oButton = new sap.m.Button({ id: "buttonId", text: "Yes", press: this.fnB() }); My controller looks like follows: sap.ui.controller("<controller-name>", { fnA: function(){<button_declaration_here>}, fnB: function(){console.log("Hello from fnB!");} }); When I...

SAPUI5 model loading

javascript,sapui5
Is there some way how to know when model is loaded? Example: sap.ui.controller("myapp.MyViewController", { onInit: function() { this.router = sap.ui.core.UIComponent.getRouterFor(this); this.router.attachRoutePatternMatched(this._handleRouteMatched, this); this.model = sap.ui.getCore().byId("app").getModel("mymodel"); }, onAfterRendering: function() { console.log(this.model); } ... In this case the model instance is defined, but it contains empty object, because no data is loaded....

Dynamic content type of table cell

sapui5
I get data from a database, make a model out of it and bind to a table. I have a problem with one databse field that contains dataURL of the image or "Not Available" if no image is present. The problem is that depending on the database field value, the...

SAPUI5 for older versions of SAP UI

javascript,sapui5,openui5
I would like to use SAPUI5 for customers who are on previous versions of SAP. Couple of customers expressed interest in Fiori but their SAP upgrade plan is far from now. I am exploring options to use SAPUI5 framework alone with alternative options. I am thinking to use a Java...

Is there a way to change the sorter icon in sapui?

javascript,sapui5
I am using sapui5 to create a table. I was wondering if I could change the default icon of the sort ascending and the sort descending to my own icons? Additional question: Is there a way to show my custom icon in the header without having to click on it...

Restart app within OPA5 test using iTeardownMyAppFrame and iStartMyAppInAFrame timed out

sapui5,qunit,openui5
I try to add another test to my existing .opa.qunit.js file which requires a complete restart of my app. What I tried was to call "iTeardownMyAppFrame" in my test and then again "iStartMyAppInAFrame" to ensure a clean setup. At first the iFrame is shown but closed immediatly and after some...

Input event suggestionItemSelected not fire

sapui5,sapui,openui5
I have a Input component: <Input value="" showSuggestion="true" showValueHelp="true" valueHelpOnly="true" valueHelpRequest="handleValueLocalHelp" suggestionItemSelected="onLiveChangeSimple" /> and this is my function: onLiveChangeSimple: function (oEvent) { console.log("OK!") }, When I clik on the input I show the suggestion items in a Help Diaolog; then I select one item and the Input value change correctly...

SAPUI5 Page Init/Re-Init

initialization,sapui5
I have a main screen with a tile the user can press to go to another page. The oninit: for this second page works fine in getting/setting the model and the data shows correctly. If I 'go back' to the first page (after I have made changes on the second...

SAPUI5: Handle click events properly

javascript,javascript-events,sapui5,openui5
I am using the SAPUI5 control GenericTile and added both headerImage and click event. When this icon is clicked, the event handler of the tile is triggered first so that I am not able to react on the icon click itself (which should perform another action of course). var oGenericTile...

What triggers a Control re-rendering after the initial page load?

sapui5,sapui,openui5
I was working with Controls in SAPUI5 and saw events like onBeforeRendering and onAfterRendering on them; I supposed a Control was rendered only one time (in the initial loading of the page); However, are there other occasions that re-render a control without full a page reload? And in what occasions...

How to call objects that uses sap.ui.require sentence

sapui5,openui5
I've been checking last openui5 documentation and I saw that there is a "new way" of creating classes. So now, using sap.ui.define we can create classes in a AMD way like the following - sap.ui.define(['jquery.sap.global', 'sap/ui/base/Object'], function(jQuery, Object) { "use strict"; var foo = Object.extend("Foo", { metadata : { properties...

SAPUI5 Filter Search

filtering,sapui5,sap-fiori
I'm Developing Fiori App with Master-Master-Detail template, First I'm filtering by date but I want to use the search box that it's generated by default. I need to use both condition filters: Date and the element specified in serach box. Somebody knows how to add search filter without remove previous...

SAPUI5/OPENUI5 - Routing with Dialogs

routing,dialog,sapui5,openui5
I´m currently stuck with the combination of routing and dialogs. I have a view with list elements and when I click on an element in the list I want the Detail view to be shown in a Dialog (Popup). The thing is, I also want the ID of the list...

OpenUI5 Code Reading

sapui5,sapui,openui5
Just for curiosity, I thought about reading the OpenUI5 code available on GitHub. However, I don't know where to start. What would be the "Chapter 1" of OpenUI5 code? There are so many libraries and code that I don't know where to begin. Can someone help me on this? Thanks...

Use Local JSON File for Databinding in SAPUI5

json,data-binding,sapui5
I have a little Problem with SAPUI5. I have the following Code: var oModel = new sap.ui.model.json.JSONModel(); oModel.loadData("JSON/saplogon.json"); var oTable = new sap.ui.table.Table({ visibleRowCount: 30, firstVisibleRow: 0 }); oTable.addColumn(new sap.ui.table.Column({ label: new sap.ui.commons.Label({text: "Server"}), template: new sap.ui.commons.TextView().bindProperty("text", "Server"), width: "40%" })); oTable.addColumn(new sap.ui.table.Column({ label: new sap.ui.commons.Label({text: "Beschreibung"}), template: new...

SAPUI5 Complex data binding example with DropdownBox in XML view

xml,json,data-binding,sapui5
I built this JSON (tested as valid) (.. don't mind that men and women are named the same here :-)): { "staff": { "berlin": [{ "male": [ {"firstName": "Lasse", "lastName": "Larsson"}, {"firstName": "Gerrit", "lastName": "Gartner"} ], "female": [ {"firstName": "Lasse", "lastName": "Larsson"}, {"firstName": "Gerrit", "lastName": "Gartner"} ] }], "paris": [{...

SAPUI5 Error resource URL

resources,sapui5
I'm programing in SAPUI5 for mobile application, and I'm using the SAPUI Tools developer. I create a default project with XML application view. I'm receiving the follow error: 2015-02-12 15:44:21 Device API logging initialized - DEVICE sap-ui-core.js:80 2015-02-12 15:44:21 registerResourcePath ('', 'https://openui5.hana.ondemand.com/resources/') - sap.ui.ModuleSystem sap-ui-core.js:80 2015-02-12 15:44:21 registerResourcePath ('com/maxinst', './')...

Populate a list from JSON data

json,list,sapui5
I am using javascript in sapui5. I have JSON data as {0:"A",1:"B",2:"C"}. I want to populate a list with the data. How can I do that?

Items are wider than the VBox in SAPUI5

sapui5
I'm using sap.m to build a simple mobile app. I've made a VBox to hold a few check boxes and embedded it in a Page. The width of the box is neatly the width of the screen (320px in the iPhone 5 device mode on Chrome). The labels of the...

Input field with different unit of measure

sapui5,openui5,sapui
I have a model filed in my JSONMOdel. The name of field id LENGTH_M (lenght in meters) In my app I use (view and edit) it into two position (two input https://openui5.hana.ondemand.com/docs/api/symbols/sap.m.Input.html) 1st input is: Length: ________ (m) where user should insert the lenght in meters 2nd input is: Length:...

Bind constraints in Input control of SAPUI5

data-binding,sapui5,openui5,sap-fiori
My rest service expose me a group of fields: each filed has a value and a list of attributes: enabled, maxLength (in case of string), minLength (in case of string), decimals (number of decimal digits - in case of float). In OpenUi5 I have: value and enabled are properties of...

SAPUI5 : Select Line item in Table not working

sapui5
I have built an XML fragment like below. <core:FragmentDefinition xmlns="sap.m" xmlns:fb="sap.ui.comp.filterbar" xmlns:core="sap.ui.core"> <Dialog stretch="false" title="Select User" showHeader="true"> <content> <fb:FilterBar reset="onReset" search="onSearch" advancedMode="true"> <fb:filterItems> <fb:FilterItem id="searchField" name="userSeacrch"> <fb:control> <SearchField width="100%" id="searchUser" showSearchButton="false"/> </fb:control> </fb:FilterItem>...

Set icon depending on text value

javascript,sapui5
I need to build a table consisting of 2 columns - the 1st is the name and the second is if the person was approved or not. Here is JSON I get from the server: {"records":[ {"approved":"Yes","name":"Doe John"}, {"approved":"No","name":"Doe Jane"}]} I use the above JSON to set model to the...

sapui5 component settings shown sometimes, sometimes undefined (same code)

javascript,asynchronous,sapui5
I want to use the same SAPUI5 component for different uses. I want to differentiate between the uses with settings, as shown here var oComponentContainer = new sap.ui.core.ComponentContainer( { url : "resources/components/clientSelector", name : "components.clientSelector", id : "components.clientSelector", propagateModel : true, settings : { bPopupView : true, iOffset : $(document).height()...

How to add multiple controls in a single table column?

sapui5,openui5
I have a small issue. I want to add two controls(TextView and Button) in a single table column. I have tried concatenation, array type to pass two controls into template but failed. Anyone please help me to solve this. this is my sample table....

SAPUI5 My fragment gets closed

fragment,sapui5
I'm Developing SAPui5 APP. I create a fragment xml with a sap.m.Popover, In Content of Popover I add 2 sap.m.MultiCombobox. When I close the selection of multicombobox my popover gets closed. Any solution? Fragment code: <core:FragmentDefinition xmlns="sap.m" xmlns:l="sap.ui.layout" xmlns:core="sap.ui.core"> <Popover class="sapUiPopupWithPadding" title="Filtro Asignación" placement="Top" > <l:VerticalLayout> <Label text="Fecha" ></Label> <DatePicker...

How the lifecycle of UI5 Control works?

sapui5,sapui,openui5
Can someone give a more detailed explanation about the lifecycle of the default events of a UI5 Control? I know there is this page on the documentation that gives an overview of a Control lifecycle, however I think it is very brief and wanted something more detailed. Can someone list...

UI5 responsive layout controls (create responsive CustomListItem)

css,responsive-design,sapui5,openui5
I built a List of CustomListItems in a XML View: <!-- List with CustomListItem (seperate Icon for event) --> <List class="cTL" id="test-list2" type="Active" headerText="CustomListItems with Icon Control" items="{path : '/products'}"> <CustomListItem title="boom" counter="3" class="cTL-item" tabindex="1"> <content> <core:Icon tabindex="2" decorative="false" color="{ path: 'price', formatter:'.setPrioColor' }" src="sap-icon://add"></core:Icon> <layout:VerticalLayout class="cTL-text">...

Data binding of property valueState

sapui5,sapui,openui5
I want this result: I have a state JSONModel contains the states that I want bind with my UI. { code:"None", descr:"Error" family:"None" } now, to have my result I write: sap.ui.getCore().byId("idCodeInput").setValueState("{state>code}"); sap.ui.getCore().byId("idDescrInput").setValueState("{state>descr}"); sap.ui.getCore().byId("idFamilyInput").setValueState("{state>family}"); and it works fine. But sap.m.Input not have valueState property and I can't bind model<-->view from...

sap.m.FlexBox and OverlayContainer

sapui5
I'm working on a signature pad feature to my app using szimek/signature_pad. When a user presses "add signature" button, the overlay container pops up. This container is used to sign and accept/clear the signature. The problem is that I want to align control buttons in a specific way using sap.m.FlexBox,...

Use insertItem after bindAggregation in Sap.m.Select

javascript,sapui5
Is my first time posting here. I have a sap.m.Select that shows the Years from oDataModel using "bindAggregation" method. My idea is to create a extra Item in the Select with text: "All Values" and Key: "*", So I tried to use the "insertItem" after the "bindAggregation", but the item...

Binding language not work

xml,internationalization,sapui5,sapui,openui5
I create my .properties file (it, en, fr) and I set the i18n Model var oI18nModel = new sap.ui.model.resource.ResourceModel({ bundleUrl: "i18n/i18n.properties" }); sap.ui.getCore().setModel(oI18nModel, "i18n"); this.setModel(oI18nModel, "i18n"); My app start correctly in italian. Now I have a button that switch to en language. This is the code: var bundleLocale=sap.ui.getCore().getModel("i18n").getProperty("/bundleLocale/"); bundleLocale="en"; sap.ui.getCore().getModel("i18n").refresh(true);...

How to break the title of tab in IconTabBar in SAPUI5

sapui5,sapui
I am trying to Break the title of Tab in IconTab Component. I tried by using the CSS. By default it has width as auto. I changes this to some 5rem after that my title is displaying with elipses [eg., I am title...., the actual title is I am title...

Order of Controller Lifecycle Hook onInit() in sap.m.NavContainer

lifecycle,sapui5,openui5
Given I have a view App.view.xml which includes the view Login.view.xml: <mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" displayBlock="true" controllerName="App"> <Shell showLogout="false"> <NavContainer id="loginNavContainer"> <mvc:XMLView id="loginView" viewName="Login" /> </NavContainer> </Shell> </mvc:View> When I add a breakpoint to the lifecycle hooks App.view.controller.onInit() and Login.view.controller.onInit() I would expect that the onInit() from the App controller is...

Browser adds $metadata to OData call

javascript,odata,sapui5
I try to consume OData service using SAPUI5 framework. When I tested my app on localhost, I did as follows: var oModel = new sap.ui.model.odata.ODataModel("proxy/http/services.odata.org/V3/(S(ql0iexfh2tyudc5p4qhx5gdf))/OData/OData.svc"); and it worked fine. But when I uploaded the app to the cloud platform, I got the following error: GET https://<accountname>.hana.ondemand.com/OData/proxy/http/services.odata.org/V3/(S(ql0iexfh2tyudc5p4qhx5gdf))/OData/OData.svc/$metadata 500 (Internal Server Error)...

Access to html basic protected image via SapUI5 & Cordova

android,cordova,xmlhttprequest,basic-authentication,sapui5
I'm trying to access an image protected by a simple http basic authentication mechanism. This example works fine when using my browser ... var mImage = sap.m.Image("Im1"); mImage.setSrc("http://user:[email protected]/image.jpg"); ... var page = new sap.m.Page({ title: "Image", content: mImage } Yet when I wrap it in a Cordova container (Android) this...

Using read function of oData model in UI5

javascript,odata,sapui5,openui5
I am coding an UI5 App which consumes a given OData Service. Now I want to get the name of an account with a given account number and Display it in a table. As I can only access the account Name via /AccountInfoSet()/ShortText I tried to use a formatter function...

Vertical label alignment in SAPUI5 (Label too high)

css,label,sapui5
I am currently working on my first SAPUI5 mobile application. I found the options for horizontal layout positioning, but my labels are shown "too high". For display I am using Google Chrome. My page theme is sap_bluecrystal and the content structure is as follows: sap.ui.layout.form.SimpleForm (Max Container Cols: 2) -->...

Bind multiple keys to a Table using template

javascript,data-binding,sapui5,openui5
I want to bind multiple keys from a JSON to a sap.ui.table.Column. I am using a JSON-View. This is how it looks like: { "Type": "sap.ui.core.mvc.JSONView", "content": [ { "Type": "sap.ui.table.Table", "id": "backendConnectorsOverviewTable", "columns": [ { "Type": "sap.ui.table.Column", "label": "Label", "template": { "Type": "sap.ui.commons.TextView", "text": "{text} {headerText}" } } ]...

SAPUI5 EventBus: Prevent stacking the same subsciptions

javascript,sapui5,event-bus,openui5
When i click a button, i want to subscribe to an event EventBus.subscribe("sChannelFoo", "sIdBar", function(){ alert("FOOBAR!"); }); I subscribe on "sChannelFoo" and sIdBar" throughout my code. What is a neat solution to make sure that I subscribe to this event only once with this button, even if I click my...

Create a UI5-Controller on the Fly

javascript,sapui5,openui5
Is it possible to create a sap.ui.controller like that: sap.ui.controller("controllerId", "{onAfterRendering: function(){}}"); Use-Case is, i have a server that creates a controller on the fly, if needed. When I get the Logic as String and try to use it like that: var oView = sap.ui.view({ type: sap.ui.core.mvc.ViewType.JSON, viewContent: viewContent, controller:...

Change application direction using Phonegap or SAPUI5

html,cordova,phonegap-plugins,phonegap-build,sapui5
I am not able to change my app direction using (html dir="ltr"), after android device language has been changed to arabic. How can I change my app direction to ltr using phonegap or sapui5?

Formatter parameter passes as null

excel,sapui5,formatter
I am trying to export table data to an Excel sheet. Everything works OK without formatter. But I have to format some cells before converting table to Excel. I'm debugging the code. Formatter function's parameter passes as null value. Here is my code: var oExport = new sap.ui.core.util.Export( { exportType...

OData service data binding

javascript,odata,sapui5
I have a hard time with displaying data from OData model. Here is the model declaration: var oModel = new sap.ui.model.odata.ODataModel("northwind/V2/(S(ql0iexfh2tyudc5p4qhx5gdf))/OData/OData.svc"); sap.ui.getCore().setModel(oModel, "odata"); I have a destination for Northwind OData service with path "/northwind". Here is my list declarations: var oResultsList = new sap.m.List(); var oListTemplate = new sap.m.StandardListItem({ path:...

Create SAPUI5 application programmatically?

sapui5,hana-cloud-platform
If it is possible at all, how do I create a new SAPUI5 application on my SAP HANA Cloud Platform account from an existing and running SAPUI5 HTML5 application? UPDATE I don't want to enter the cockpit, I want to carete a new app on my account using only javascript/SAPUI5/whatever....

How to show a dialog in SAPUI5 triggerd by the controller and not a view event? (Push notification)

model-view-controller,sapui5
In a SAPUI5 controller of a master view I trigger a oModel.read() request to read some data (async). This read will be done each time the page will be reached during navigation. onInit: function() { var that = this; this.getRouter().getRoute("PageName").attachMatched(this.onRouteMatched, this); }, onRouteMatched : function(oEvent) { ... oModel.read(....); // this...

Deleting a view and onclick opening it again, as if it is new - SAPUI5

javascript,jquery,node.js,model-view-controller,sapui5
I have a multiple View setup, a main View and then modules who are opened on button click after certain actions. Right now the view is reset by me whenever its opened, but what I want to accomplish is, when the view is left, that its gone from the core...

SAPUI5 extending table

sapui5
I am trying to extend SAPUI5 TreeTable. In the simplest form my extended table looks like this: jQuery.sap.declare("my.app.ExtendedTable"); jQuery.sap.require("sap.ui.table.library"); jQuery.sap.require("sap.ui.table.TreeTable"); sap.ui.table.TreeTable.extend('my.app.ExtendedTable', {}); So I am not really adding any new properties or overriding any methods yet, until the basics work. If I place it on my XML view as an...

Error on load Model Uncaught TypeError: Failed to execute 'serializeToString' on 'XMLSerializer': parameter 1 is not of type 'Node'

xml,model-view-controller,sapui5
when i call my XMLModel and try to oModel.getXML a problem appears on browser console : "Uncaught TypeError: Failed to execute 'serializeToString' on 'XMLSerializer': parameter 1 is not of type 'Node'" But if, i oModel.setXML directly in code like: oModel.setXML("<questionnaire><question><id>A01</id><text>Whats is you ID Number?</text><answer>1234</answer></question></questionnaire>"); then the error doesn't happen Here...

source code for demokit

javascript,sapui5
I'm new to SAP and SAPUI5 in particular and trying to improve my skills in this domain. I'm looking for some demo apps built using SAPUI5, and found Demo kit (https://sapui5.netweaver.ondemand.com/sdk/test-resources/sap/m/demokit/tdg/index.html?responderOn=true) However I can't find the source code for this apps, neither for other non-trivial demos. Even the build-it-yourself demo...

How can I add a list of items in a popover by using sap ui5?

json,list,sapui5,popover,sapui
I'm trying to add a list of items in a popover but somehow is not working :/ I populate the list with data from a JSON file. Please find below my code: var popoverButton = new sap.ui.unified.ShellHeadItem("popoverButton",{ tooltip: "Configuration", icon: "sap-icon://generate-shortcut", showSeparator:false, press:function(oEvent){ var oButton = oEvent.getSource(); if (!this._oPopover){ this._oPopover...

Loop through multi dimensional object

javascript,sapui5
Is there a more efficient way to loop through structure like following than doing for() for every level there is ? [{a:foo,b:[{a:bar},{a:bar}]},{a:bar,b:[]},...] I need to filter out all the items which property a contains certain data and if it has property b with some elements then loop through those also....

Retrieving the id from a control to use in navigation

javascript,sapui5
I have a view with tiles, each of which have an id="foo" property, and a press property pointing to a function in the controller. The problem is I can get the id of the tile, but it is appended automatically to the view name, __xmlview1--foo1. This can change if other...

Focus on search bar when I open master

sapui5,openui5,sapui
I have a master-detail app (SplitContainer in HideMode) In my master page I have a list item with a search input on the top. From any page if I open the master I have always the same master list page. I would like that when I open the master the...

Navigation Problems in a sapui5 unified Shell (sap.ui.unified.Shell)

shell,navigation,sapui5,sapui,openui5
I have used unified Shell control in order to implement the facebook-like swipe menu and I integrated in it a list so that I can enter menu items. The idea is that when a user clicks on a certain list item in the menu he will get redirected to a...

Fit OpenUI5 BorderLayout to Screensize

javascript,layout,sapui5,openui5
I am using a small script (full code at the bottom of the question) to create a BorderLayout - top, left, right and center. I fill those parts with sap.ui.commons.layout.BorderLayoutAreas (as shown in this examples.) My main problem is that I want this Layout to fit the whole Browser screen,...

ObjectListItem “press” event is not fired

javascript,model-view-controller,sapui5,openui5
Whether this <List id="list" items="{/Report}"> <items> <ObjectListItem press="onSelect" title="{TYPE}"> </ObjectListItem> </items> </List> nor this <List id="list" items="{/Report}" itemPress="onSelect"> <items> <ObjectListItem title="{TYPE}"> </ObjectListItem> </items> </List> fires onSelect : function (oEvent) { 'use strict'; console.log("onSelect"); } in the Controller. What may cause this? There is no related error message in the console....

SAPUI5 logOff() with Shell

shell,logout,sapui5,logoff
How would I realize the logoff function in Shell control having this API example: https://sapui5.hana.ondemand.com/sdk/docs/api/symbols/sap.ui.commons.ApplicationHeader.html#event:logoff var oLogoff = new sap.ui.commons.ApplicationHeader(); ... // within the Shell (function logout) logout : function(oEvent) { oLogoff.fireLogoff(); // this.fireLogoff() also not working }, ... EDIT: oShell.fireLogout(); --> seems to be right, but this Ends up...

How is localized data binding set up with JSON files and XML views?

javascript,sapui5
I have an XMLView home page containing some tiles. These tiles are populated from a JSON file. The tiles have a 'title' attribute which requires i18n data binding. Part of the XML view: <TileContainer id="container" tiles="{/TileCollection}"> <StandardTile icon="{icon}" title="{title}" press="onPress" /> </TileContainer> JSON file: { "TileCollection" : [ { "icon"...

SAPUI5 binding issue: list item links maintained in json file do not work

javascript,json,binding,sapui5
following situation. I have a table defined in an xml view (text content is located in a json file). For every list item, there's a press event defined so that a click on the item takes me to another page or opens a file. Everything is properly displayed but the...

What is the purpose of subroutes when we can achieve through normal routes in sapui5

sapui5
Is there any specific reason for using subroutes in SAPUI5. { pattern: "album/{catIndex}", name: "songs", view: "songlist", viewLevel : 3, targetAggregation: "masterPages" , subroutes: [ { pattern: "category/{catIndex}/subcat/{subCatIndex}", name: "Products", view: "songdetails", viewLevel : 4, targetAggregation: "detailPages", }] } Here I have used subroutes, to get the scope of the...