sapui5 , Input field loses focus when created dynamically within a table -SAP UI5


Input field loses focus when created dynamically within a table -SAP UI5

Question:

Tag: sapui5

I am creating a input field dynamically in a table based on the data entered using sap ui5 xml views. The input field doesn't allow user to type continuously. It loses focus after every character is typed. How can I resolve this?

<Input value="{newProduct>CustomKeyDisplayLabel}" class="inputfeildclass" />

Answer:

This is related with the behavior of the input which updates model with every keystroke. and causes a rendering .This is changed in 1.26 version. The value is first checked, updated and modified when the user has finished editing.


Related:


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

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

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

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

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?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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?

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

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

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

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