
<mvc:View
xmlns:l="sap.ui.layout"
xmlns:core="sap.ui.core"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<List
id="dimensions"
items="{/dimensions/(MEASURES_DIMENSION)/members}">
<StandardListItem
title="{text}"
description="{key}"/>
</List>
</mvc:View>
Aspect | Lumira Designer | SAPUI5 |
Elements | Component | Control |
Data is coming from | Data Source (BW, HANA, ...) | Model (JSON Model, ODataModel) |
Logic is written in | Event Handlers | Controller |
UI is stored in | App or Composite | View (e.g. XML View |
Bind data to a complex element | Set data source property | List Binding |
Bind data to property | Use a Property Binding | Binding Path |
Path | Description |
---|---|
/dimensions | List of dimensions; column dimensions first, then row dimensions |
/dimensions/0 | First dimension - which is the dimension on columns, index 0. |
/dimensions/<key> | Dimension with the given internal key |
/dimensions/(MEASURES_DIMENSION) | The dimension containing the measures. You can use the placeholder "(MEASURES_DIMENSION)" also for all subsequent path instead of index or key. |
/dimensions/<indexOrKey>/key | Key of the specified dimension |
/dimensions/<indexOrKey>/text | Language-dependent name of the dimension |
/dimensions/<indexOrKey>/axis | "COLUMNS" | "ROWS": Axis on which the dimension is located |
/dimensions/<indexOrKey>/axis_index | Axis tuple index of the dimension, >= 0 |
/dimensions/<indexOrKey>/containsMeasures | true|false: Does dimension contain measures? |
/dimensions/<indexOrKey>/attributes | List of attributes (not valid when result set has no attributes) |
/dimensions/<indexOrKey>/attributes/0/key | The key of the first attribute of the given dimension |
/dimensions/<indexOrKey>/attributes/<indexOrKey>/text | The text of the given attribute if the given dimension |
/dimensions/<indexOrKey>/members | Array of dimension's members |
<mvc:View
controllerName="sap.m.sample.ListSelection.List"
xmlns:l="sap.ui.layout"
xmlns:core="sap.ui.core"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<List
id="dimensions"
selectionChange="handleSelectionChange"
mode="SingleSelect"
items="{/dimensions}">
<StandardListItem
title="{text}"
description="{key}"/>
</List>
</mvc:View>
sap.ui.define([
'sap/ui/core/mvc/Controller'
], function(Controller) {
"use strict";
var ListController = Controller.extend("sap.m.sample.ListSelection.List", {
onInit : function (evt) {
},
handleSelectionChange: function (oEvent) {
debugger;
var selectedKey = oEvent.getParameter("listItem").getDescription();
var comp = this.getView().getParent();
var sel = {};
sel[selectedKey] = ["*"];
comp.setSelection(sel);
comp.setSelectionType("DIMENSION");
comp.fireDesignStudioPropertiesChangedAndEvent(["selection", "selectionType"], "onSelect");
}
});
return ListController;
});
if (me.getSelectionType() == ResultSetSelectionType.DIMENSION) {
var selection = me.getSelection();
var dimName = "";
selection.forEach(function(value, key) {
dimName = key;
});
APPLICATION.alert(dimName);
}
<mvc:View
controllerName="sap.m.sample.ListSelection.List"
xmlns:l="sap.ui.layout"
xmlns:core="sap.ui.core"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<List
id="dimensions"
selectionChange="handleSelectionChange"
mode="SingleSelect"
items="{/dimensions/(MEASURES_DIMENSION)/members}">
<StandardListItem
title="{text}"
description="{key}"/>
</List>
</mvc:View>
sap.ui.define([
'sap/ui/core/mvc/Controller'
], function(Controller) {
"use strict";
var ListController = Controller.extend("sap.m.sample.ListSelection.List", {
onInit : function (evt) {
},
handleSelectionChange: function (oEvent) {
debugger;
var selectedKey = oEvent.getParameter("listItem").getDescription();
var comp = this.getView().getParent();
comp.setSelection({"[Measures]": [selectedKey]});
comp.setSelectionType("MEMBER");
comp.fireDesignStudioPropertiesChangedAndEvent(["selection", "selectionType"], "onSelect");
}
});
return ListController;
});
if (me.getSelectionType() == ResultSetSelectionType.MEMBER) {
var member = me.getSelectedMember("[Measures]");
APPLICATION.alert(member.text);
}
Path | Description |
---|---|
/'dim1': '*' | Keep all cellls - but iterate over the different members of dim1 |
/'dim1': 'm11', 'dim2': '*' | Reduce data to all cells with dimension1 being 'm11' and iterates over all members of dim2 |
/'dim1': '?' | Same as "/'dim1': '*'", but skip totals |
/'dim1': '*'/0 | First member of the list created by "/'dim1': '*'". The result is the same as "'dim1': 'm11'" (assuming that 'm11' is the first member of dim1 in the result set. Depending in the navigation state this expression might select one or more cells. |
/'dim1': '*'/0/value | The float value of the first data cell selected by "'dim1': 'm11'". If "'dim1': 'm11'" selected multiple cells, the value might not be the expected one. In this case it would be better to refine the selection. |
/'dim1': '*'/0/formattedValue | The formatted string value of the first data cell selected by "'dim1': 'm11'". If "'dim1': 'm11'" selected multiple cells, the value might not be the expected one. In this case it would be better to refine the selection. |
/'dim1': '*'/0/'dim2': 'm21'/value | The float value of the first cell selected with "'dim1': 'm11, 'dim2': 'm21'". |
/'dim1': '*'/0/'dim2': '*' | Same as "/'dim1': 'm11', 'dim2': '*'": Reduce the data to all cells with dimension1 being 'm11' and iterates over all members of dim2 |
/'dim1': '*'/0/format/LocalException-1 | If "LocalException-1" is the key of a conditional format, and the cell has some level for this conditional format type assigned, you will receive a number between 0 and 9. Else it will be null. |
<mvc:View
xmlns:l="sap.ui.layout"
xmlns:core="sap.ui.core"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<List
id="data"
items="{/'store_city': '*', '(MEASURES_DIMENSION)': 'store_cost'}">
<StandardListItem
title="{value}"
description="{formatedValue}"/>
</List>
</mvc:View>
Path | Description |
---|---|
/'dim1': '*'/0/dim1/text | Returns the member text of the first member of dim1. Identical to "/dimensions/dim1/members/0/text" (assuming that member0 also appears in the result set as first member). |
<mvc:View
xmlns="sap.ui.table"
xmlns:mvc="sap.ui.core.mvc"
xmlns:u="sap.ui.unified"
xmlns:c="sap.ui.core"
xmlns:m="sap.m">
<Table
rows="{/store_city:'*'}"
title="Cities"
visibleRowCount="7">
<columns>
<Column width="12rem">
<m:Label text="Store City"/>
<template>
<m:Text text="{store_city/text}"/>
</template>
</Column>
<Column width="11rem">
<m:Label text="Store Cost"/>
<template>
<m:Text text="{'(MEASURES_DIMENSION)': 'store_cost'/formattedValue}"/>
</template>
</Column>
</columns>
</Table>
</mvc:View>
<mvc:View
controllerName="sap.m.sample.ListSelection.List"
xmlns="sap.ui.table"
xmlns:mvc="sap.ui.core.mvc"
xmlns:u="sap.ui.unified"
xmlns:c="sap.ui.core"
xmlns:m="sap.m">
<Table
id="theTable"
rows="{/product_id:'*'}"
title="Products"
selectionMode="MultiToggle"
rowSelectionChange="onTableRowSelected"
visibleRowCount="7">
<columns>
<Column width="20rem">
<m:Label text="{/dimensions/product_id/text}"/>
<template>
<m:Text text="{product_id/text} ({product_id/key})"/>
</template>
</Column>
<Column width="8rem">
<m:Label text="{/dimensions/(MEASURES_DIMENSION)/members/store_sales/text}"/>
<template>
<m:Text text="{'(MEASURES_DIMENSION)': 'store_sales', gender: '(RESULT_MEMBER)'/value}"/>
</template>
</Column>
<Column width="10rem">
<m:Label text="{/dimensions/(MEASURES_DIMENSION)/members/store_sales/text} Details"/>
<template>
<m:Select change="onDropdownSelect"
width="100%" items="{'(MEASURES_DIMENSION)': 'store_sales', 'gender': '*'}">
<c:Item key="{gender/key}" text="{gender/text}: {value}"/>
</m:Select>
</template>
</Column>
</columns>
</Table>
</mvc:View>
sap.ui.define([ 'sap/ui/core/mvc/Controller' ], function(Controller) {
"use strict";
var ListController = Controller.extend("sap.m.sample.ListSelection.List", {
onInit : function(evt) {
},
onTableRowSelected : function(oEvent) {
debugger;
this.sendSelection("DATA");
},
onDropdownSelect : function(oEvent) {
debugger;
var dropdown = oEvent.getSource();
var key = dropdown.getSelectedKey();
this.sendSelection("DROPDOWN", key);
},
sendSelection : function(selectionType, gender) {
var table = this.byId("theTable");
var indexes = table.getSelectedIndices();
var selectedProductKeys = [];
for (var i = 0; i < indexes.length; i++) {
var index = indexes[i];
var context = table.getRows()[index].getBindingContext();
var key = context.getProperty("product_id/key");
selectedProductKeys.push(key);
}
var comp = this.getView().getParent();
var selection = {
"product_id" : selectedProductKeys
};
comp.setSelection(selection);
if (gender) {
selection.gender = gender;
}
comp.setSelectionType(selectionType);
comp.fireDesignStudioPropertiesChangedAndEvent([ "selection", "selectionType" ], "onSelect");
}
});
return ListController;
});
var selection = me.getSelection();
CHART_1.setDataSelection(selection);
if (me.getSelectionType() == "DROPDOWN") {
APPLICATION.alert("Dropdown: " + selection["gender"][0]);
}
<mvc:View
xmlns="sap.suite.ui.microchart"
xmlns:m="sap.m"
xmlns:mvc="sap.ui.core.mvc">
<ComparisonMicroChart scale="M" class="sapUiSmallMargin" press="press" width="30rem" minValue="-30" maxValue="70"
colorPalette="#5cbae6, #b6d957, #fac364, #8cd3ff, #d998cb, #f2d249, #93b9c6, #ccc5a8, #52bacc, #dbdb46, #98aafb"
data="{/'store_city': '?', '(MEASURES_DIMENSION)': 'store_sales'}">
<data>
<ComparisonMicroChartData title="{store_city/text}" value="{value}"/>
</data>
</ComparisonMicroChart>
</mvc:View>
define(["sap/designstudio/sdk/SDKModel"], function(SDKModel) {
<soneSuperType>.extend("<Id>", {
setData: function(json) {
var model = new SDKModel(json);
this.setModel(model);
},
// ...
});
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
23 | |
23 | |
22 | |
15 | |
14 | |
9 | |
8 | |
8 | |
7 | |
6 |