FAQ Database Discussion Community


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...

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">...

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...

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);...

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...

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:...

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...

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...

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...

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:...

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...

Organize multi-app project with share code

git,github,gruntjs,openui5,sapui
I have a serious problem (!!!) about organizing my develop environment; I have two apps: app1 and app2. This apps are written using OpenUI5 (but this detail is not important) app1 and app2 are similar and share some code (for example the code to login). I use git (with git-flow)...

Bind Items to a DropDownBox in OpenUI5

javascript,data-binding,openui5
I am trying to bind a Value inside of an Array with Objects to a sap.ui.commons.DropdownBox. My JSON-structure looks like that: { "forms": [ { "name": "First Object" }, { "name": "Second Object" } ] } Now I try to bindItems to my DropdownBox like that: var oItemTemplate = new...

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...

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...

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...

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,...

OpenUI5 binding property with a function, instead of direct access

javascript,openui5,2-way-object-databinding
I would like to bind a property (flag_baz in this case) from a JSONModel to a checkbox. Thing is that the json model looks like this. { foo: "Foo", bar:"Bar", flag_baz : "X" } in this case X means "true" and an empty string means "false" What i would like...

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...

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"); ...

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...

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...

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....

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...

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....

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...

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}" } } ]...

Open UI5 sap-ui-core.js Failed to load resource

javascript,jquery,cordova,openui5
I've been trying to get started on building OpenUI5 apps using cordova. The latest issue I am facing is that I can't seem to use my local "resources" folder (where all the OpenUI5 js files are stored). I am running the index.html file on chrome with web security disabled to...

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...

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...

“%” 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 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...