sapui5

How to use applyVariant function on smarttables?

血红的双手。 提交于 2019-12-19 10:14:51
问题 How can I use applyVariant function on a smarttable ? The documentation exist here: https://sapui5.hana.ondemand.com/sdk/#/api/sap.ui.comp.smarttable.SmartTable/methods/applyVariant But it does not say what the structure of oVariantJSON parameter should be!!! 回答1: Just try to apply a filter on your smart table and in the beforeRebindTable event of your smart table try to use the following code: onBeforeRebindTable: function(oEvent) { var oSmartTable = oEvent.getSource(); console.log

OData Model Not Working

 ̄綄美尐妖づ 提交于 2019-12-19 09:27:25
问题 I am trying to use expand option in my XML view but it's resulting no data. Data are coming from backend as I can see in debugging under 'Network' option but there seems to be some binding issue in XML view. Component.js sap.ui.define([ "sap/ui/core/UIComponent", "sap/ui/Device", "sem/stock_app/model/models" ], function(UIComponent, Device, models) { "use strict"; return UIComponent.extend("sem.stock_app.Component", { metadata: { manifest: "json" }, /** * The component is initialized by UI5

Using model for ID assignment

北战南征 提交于 2019-12-19 04:39:11
问题 I tried to assign ID to items in my select control using model binding, but ended with an error. Here is my code: Model: { "languages": [ { "language": "English", "locale": "en" }, { "language": "German", "locale": "de" } ] } Select control: var oLanguageSelection = new sap.m.Select({ name: 'languageSelection', id: 'languageSelection', items: { path: "languages>/languages", template: new sap.ui.core.Item({ id: "{languages>locale}", //this is the problematic part text: "{languages>language}",

How to retrieve View outside the controller - Openui5

荒凉一梦 提交于 2019-12-19 04:05:58
问题 If I use this.getView() inside the controller of a view I can retrieve it without problems. How can I retrieve the view if I am outside the controller (e. g. in controller of another view)? I try sap.ui.core.Core().byId("<name of view>") but it returns undefined . 回答1: You can instantiate another view using: var view = sap.ui.jsview("<name of view>"); If you´re using different view types you can choose the necessary function from here. To avoid multiple instantiation you could do something

How to add ColumnListItem to a table inside a page in MVC from other page controller

梦想与她 提交于 2019-12-18 09:28:38
问题 I have a SAPUI5 application written in MVC I have a view called oPage4: var landscapePage = new sap.m.Page({ title : "Landscape Name", showNavButton : true, navButtonPress : [oController.back,oController], footer : new sap.m.Bar({ id : 'landscapePage_footer', contentMiddle : [ new sap.m.Button({ }), new sap.m.Button({ }) ] }), }); oLandscapePageTable = new sap.m.Table("landscape", { inset : true, visible : true, getIncludeItemInSelection : true, showNoData : false, columns : [ new sap.m

sap.m.IconTabBar: How to Make Header Sticky / Only Content Scrollable

拟墨画扇 提交于 2019-12-18 09:17:19
问题 I'm looking for a way to make a sap.m.IconTabBar sticky, meaning that the tab bar stays fixed while you can scroll the contents. As far as I can see, there is no standard attribute support for this. Anyone implemented this? PS: Should be possible by using CSS attribute position: fixed to the header part of the component. 回答1: here my comment again as answer: In the example i wrapped the content of the sap.m.IconTabBar in a sap.m.ScrollContainer and set the vertical property to true. http:/

How to load sap.ui.comp.smarttable.SmartTable faster?

ⅰ亾dé卋堺 提交于 2019-12-18 09:17:14
问题 In SAPUI5 when you add a sap.m.DatePicker to your app for the first time it takes some seconds to load the required files and open the date picker. In the API they explained: Note: The sap.ui.unified.Calendar is used internally only if the DatePicker is opened (not used for the initial rendering). If the sap.ui.unified library is not loaded before the DatePicker is opened, it will be loaded upon opening. This could lead to a waiting time when the DatePicker is opened for the first time. To

Form with Multiple Columns?

孤街浪徒 提交于 2019-12-18 09:14:45
问题 I defined the following simple form: <form:SimpleForm id="SimpleFormChange354" editable="true" layout="ResponsiveGridLayout" title="Address" labelSpanXL="2" labelSpanL="2" labelSpanM="3" labelSpanS="12" adjustLabelSpan="false" emptySpanXL="0" emptySpanL="0" emptySpanM="0" emptySpanS="0" columnsXL="2" columnsL="2" columnsM="1" singleContainerFullSize="false" > <Label text="Name1"/> <Input/> <Label text="Name2"/> <Input/> <Label text="Name3"/> <Input/> </form:SimpleForm> As you can see: How to

TooltipBaseRenderer.js: 404 - NOT FOUND

余生长醉 提交于 2019-12-18 09:08:35
问题 I extended sap.ui.core.TooltipBase with mouseover event handling which is attached to some sap.ui.core.Icon in the ChartContainer: sap.ui.define(function () { "use strict"; return sap.ui.core.TooltipBase.extend("dvd.rl.component.ChartContainer.parts.TooltipBase.TooltipBase", { metadata: { events: { "onmouseover" : {} } }, oView: null, setView : function(view){ this.oView = view; }, // the hover event handler, it is called when the Button is hovered - no event registration required onmouseover

Using html fragments with declarative html views

删除回忆录丶 提交于 2019-12-18 07:15:21
问题 I am trying to decompose a large html view down into smaller, more manageable chunks. Is it possible to use fragments to do this? For example, i have a fragment file (view.configurator.Summary.fragment.html) containing the following: <div data-sap-ui-type="sap.m.Button" data-text="Hello"></div> In my parent file, I try to include the fragment as follows: <div data-sap-ui-type="sap.m.VBox" class="summary-panel-content"> <div data-sap-ui-type="sap.ui.core.Fragment" data-fragment-name="view