fiveapples 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +7 -0
  2. data/bin/fiveapples +7 -0
  3. data/lib/config5.ru +31 -0
  4. data/lib/fiveapples.db3 +0 -0
  5. data/lib/fiveapples.rb +46 -0
  6. data/lib/model.rb +58 -0
  7. data/lib/ui5/Component.js +41 -0
  8. data/lib/ui5/controller/BreederList.controller.js +68 -0
  9. data/lib/ui5/controller/Breeder_Create.controller.js +82 -0
  10. data/lib/ui5/controller/Breeder_Detail.controller.js +89 -0
  11. data/lib/ui5/controller/CultivarList.controller.js +46 -0
  12. data/lib/ui5/controller/Cultivar_Create.controller.js +100 -0
  13. data/lib/ui5/controller/Cultivar_Detail.controller.js +204 -0
  14. data/lib/ui5/controller/FiveApplesApp.controller.js +62 -0
  15. data/lib/ui5/controller/MCultivarList.controller.js +96 -0
  16. data/lib/ui5/controller/MenuList.controller.js +28 -0
  17. data/lib/ui5/controller/NotFound.controller.js +9 -0
  18. data/lib/ui5/controller/ParentageList.controller.js +71 -0
  19. data/lib/ui5/controller/Parentage_Create.controller.js +134 -0
  20. data/lib/ui5/controller/Parentage_Detail.controller.js +116 -0
  21. data/lib/ui5/controller/VibertBaseController.js +40 -0
  22. data/lib/ui5/i18n/i18n.properties +7 -0
  23. data/lib/ui5/index.html +33 -0
  24. data/lib/ui5/manifest.json +194 -0
  25. data/lib/ui5/model/formatter.js +1 -0
  26. data/lib/ui5/model/models.js +19 -0
  27. data/lib/ui5/view/BreederList.view.xml +50 -0
  28. data/lib/ui5/view/BreederOptio.fragment.xml +21 -0
  29. data/lib/ui5/view/Breeder_Create.view.xml +26 -0
  30. data/lib/ui5/view/Breeder_Detail.view.xml +53 -0
  31. data/lib/ui5/view/CultivarList.view.xml +58 -0
  32. data/lib/ui5/view/CultivarOptio.fragment.xml +23 -0
  33. data/lib/ui5/view/Cultivar_Create.view.xml +33 -0
  34. data/lib/ui5/view/Cultivar_Detail.view.xml +93 -0
  35. data/lib/ui5/view/FiveApplesApp.view.xml +9 -0
  36. data/lib/ui5/view/MCultivarList.view.xml +43 -0
  37. data/lib/ui5/view/MenuList.view.xml +18 -0
  38. data/lib/ui5/view/NotFound.view.xml +9 -0
  39. data/lib/ui5/view/ParentageList.view.xml +64 -0
  40. data/lib/ui5/view/Parentage_Create.view.xml +26 -0
  41. data/lib/ui5/view/Parentage_Detail.view.xml +51 -0
  42. metadata +128 -0
@@ -0,0 +1,116 @@
1
+ sap.ui.define([
2
+ "sap/ui/core/mvc/Controller",
3
+ "sap/m/MessageToast",
4
+ 'sap/ui/core/Fragment',
5
+ 'sap/ui/model/Filter',
6
+ "sap/ui/model/odata/ODataModel",
7
+ "sap/ui/core/routing/History",
8
+ "./VibertBaseController",
9
+ ], function (Controller, MessageToast, Fragment, Filter, ODataModel, History, VibertBaseController) {
10
+ "use strict";
11
+ return VibertBaseController.extend("vibert.controller.Parentage_Detail", {
12
+ _attachDetailMatched: function () {
13
+ this._oRouter = sap.ui.core.UIComponent.getRouterFor(this);
14
+ this._oRouter.getRoute("parentage_detail").attachPatternMatched(this._onDetailMatched, this);
15
+ },
16
+
17
+ _onDetailMatched : function (oEvent) {
18
+ var oObject = oEvent.getParameter("arguments");
19
+ var sObjectKey = "cultivar_id='" + oObject.cultivar_id + "',ptype_id='" + oObject.ptype_id + "',parent_id='" + oObject.parent_id + "'" ;
20
+ var sObjectPath = "/parentage(" + sObjectKey + ")" ;
21
+ // MessageToast.show(sObjectPath);
22
+ this._sObjectPath = sObjectPath;
23
+ var oView = this.getView();
24
+ var oModel = sap.ui.getCore().getModel();
25
+ oView.setModel(oModel);
26
+ oView.bindElement({ path: sObjectPath});
27
+
28
+
29
+ },
30
+ _onBindingChange : function (oEvent) {
31
+ var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
32
+ // No data for the binding
33
+ //if (!this.getView().getBindingContext()) {
34
+ // oRouter.navTo("notFound");
35
+ //}
36
+ },
37
+ onSave: function() {
38
+ var oView = this.getView();
39
+ var oModel = oView.getModel();
40
+ var sPath = this._sObjectPath;
41
+ var mParms = {};
42
+
43
+ // oModel.updateBindings();
44
+
45
+ var oData = oModel.getData(sPath);
46
+ function onSuccessHandler(){
47
+ oModel.refresh();
48
+ MessageToast.show("Update success");
49
+ }
50
+ function onErrorHandler(){ MessageToast.show("Update failed"); }
51
+
52
+ mParms.success = onSuccessHandler;
53
+ mParms.error = onErrorHandler;
54
+ mParms.merge = false;
55
+ // oModel.setTokenHandlingEnabled(true);
56
+ // oModel.updateSecurityToken();
57
+ oModel.update( this._sObjectPath, oData, mParms );
58
+
59
+ },
60
+
61
+
62
+
63
+ onNavBack: function () {
64
+ var oHistory = History.getInstance();
65
+ var sPreviousHash = oHistory.getPreviousHash();
66
+
67
+
68
+ if (sPreviousHash !== undefined) {
69
+ window.history.go(-1);
70
+ } else {
71
+ var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
72
+ oRouter.navTo("ParentageList", true);
73
+ }
74
+ },
75
+ inputId : "",
76
+ inputDescrId: "",
77
+
78
+ onIDValueHelp : function (oEvent) {
79
+
80
+ this.inputId = oEvent.getSource().getId();
81
+ this.inputDescrId = this.inputId + "_descr";
82
+
83
+ // create value help dialog
84
+ if (!this._valueHelpDialog) {
85
+ this._valueHelpDialog = sap.ui.xmlfragment(
86
+ "vibert.view.Dialog", this );
87
+
88
+ this.getView().addDependent(this._valueHelpDialog);
89
+ }
90
+
91
+ this._valueHelpDialog.open( '' );
92
+ },
93
+
94
+ _handleValueHelpSearch : function (evt) {
95
+ var sValue = evt.getParameter("value");
96
+ var oFilter = new Filter( "name",
97
+ sap.ui.model.FilterOperator.Contains, sValue
98
+ );
99
+ evt.getSource().getBinding("items").filter([oFilter]);
100
+ },
101
+
102
+ _handleValueHelpClose : function (evt) {
103
+ var oSelectedItem = evt.getParameter("selectedItem");
104
+ if (oSelectedItem) {
105
+ var IDInput = this.getView().byId(this.inputId);
106
+ IDInput.setValue(oSelectedItem.getTitle());
107
+
108
+ var oText = this.getView().byId(this.inputDescrId);
109
+ oText.setText(oSelectedItem.getDescription());
110
+
111
+ }
112
+ evt.getSource().getBinding("items").filter([]);
113
+
114
+ }
115
+ });
116
+ });
@@ -0,0 +1,40 @@
1
+ sap.ui.define(["sap/ui/core/mvc/Controller",
2
+ "sap/m/MessageToast",
3
+ "sap/ui/model/odata/ODataModel",
4
+ "sap/ui/commons/Dialog",
5
+ "sap/ui/model/resource/ResourceModel"],
6
+ function (Controller, MessageToast, ODataModel, Dialog, ResourceModel) {
7
+ "use strict";
8
+ return Controller.extend("VibertBaseController", {
9
+ parenstypusDescriptioMap : {},
10
+
11
+ onInit : function() {
12
+ this._loadJsonModels();
13
+ this._attachDetailMatched();
14
+ },
15
+ _loadJsonModels : function() {
16
+ // get data for parenstypusDescriptioMap
17
+ var oParameters = new Map();
18
+ var ojModel = new sap.ui.model.json.JSONModel();
19
+ ojModel.loadData("http://localhost:9494/odata/par_type",oParameters,false,"GET",true,true);
20
+ sap.ui.getCore().setModel(ojModel, "myPtModel");
21
+ this.getView().setModel(ojModel, "myPtModel");
22
+ var a = ojModel.getProperty("/d/results");
23
+ for (var i = 0; i < a.length; i++) {
24
+ this.parenstypusDescriptioMap[a[i].ID]= a[i].descriptio;
25
+ }
26
+ // merge lookup map to be used later
27
+ ojModel.setData({"map":this.parenstypusDescriptioMap},true);
28
+ // this.parenstypusDescriptioMap = ojModel.getProperty("/map");
29
+ },
30
+ parentageTypeDescription: function(sTid) {
31
+ //var ojModel = sap.ui.getCore().getModel("myPtModel");
32
+ //var map = ojModel.getProperty("/map");
33
+ return this.parenstypusDescriptioMap[sTid];
34
+ },
35
+ _attachDetailMatched : function(){},
36
+
37
+ });
38
+ });
39
+
40
+
@@ -0,0 +1,7 @@
1
+ # App Descriptor
2
+ appTitle=Five Apples Demo
3
+ appDescription=A fully open source OData openui5 demo app
4
+
5
+ homePageTitle=Home
6
+ parentageListPage=List of parentage records
7
+ cultivarListPage=List of cultivars
@@ -0,0 +1,33 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>OpenUI5 App</title>
5
+
6
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
7
+ <meta charset="UTF-8">
8
+
9
+
10
+ <script id="sap-ui-bootstrap" type="text/javascript"
11
+ src="https://openui5.hana.ondemand.com/1.60.22/resources/sap-ui-core.js"
12
+ data-sap-ui-theme="sap_belize"
13
+ data-sap-ui-libs="sap.m"
14
+ data-sap-ui-bindingSyntax="complex"
15
+ data-sap-ui-compatVersion="edge"
16
+ data-sap-ui-preload="async"
17
+ data-sap-ui-resourceroots='{"vibert": "./"}'
18
+ >
19
+ </script>
20
+
21
+ <script>
22
+ sap.ui.getCore().attachInit( function () {
23
+ new sap.m.Shell({
24
+ app : new sap.ui.core.ComponentContainer({
25
+ name : "vibert",
26
+ height : "100%" })
27
+ }).placeAt("content");
28
+ });
29
+ </script>
30
+
31
+ </head>
32
+ <body class="sapUiBody" id="content" ></body>
33
+ </html>
@@ -0,0 +1,194 @@
1
+ {
2
+ "_version": "1.1.0",
3
+ "sap.app": {
4
+ "_version": "1.1.0",
5
+ "id": "vibert",
6
+ "type": "application",
7
+ "i18n": "i18n/i18n.properties",
8
+ "title": "{{appTitle}}",
9
+ "description": "{{appDescription}}",
10
+ "applicationVersion": {
11
+ "version": "1.0.0"
12
+ }
13
+ },
14
+ "sap.ui": {
15
+ "_version": "1.1.0",
16
+ "technology": "UI5",
17
+ "deviceTypes": {
18
+ "desktop": true,
19
+ "tablet": true,
20
+ "phone": true
21
+ },
22
+ "supportedThemes": [
23
+ "sap_bluecrystal"
24
+ ]
25
+ },
26
+ "sap.ui5": {
27
+ "_version": "1.1.0",
28
+ "rootView": "vibert.view.FiveApplesApp",
29
+ "dependencies": {
30
+ "minUI5Version": "1.30",
31
+ "libs": {
32
+ "sap.m": {}
33
+ }
34
+ },
35
+ "models": {
36
+ "i18n": {
37
+ "type": "sap.ui.model.resource.ResourceModel",
38
+ "settings": {
39
+ "bundleName": "vibert.i18n.i18n"
40
+ }
41
+ },
42
+ "myPtModel": {"type": "sap.ui.model.json.JSONModel" }
43
+ },
44
+ "routing": {
45
+ "config": {
46
+ "routerClass": "sap.m.routing.Router",
47
+ "viewType": "XML",
48
+ "viewPath": "vibert.view",
49
+ "controlId": "FiveApplesApp",
50
+ "controlAggregation": "detailPages",
51
+ "bypassed": { "target": "notFound" }
52
+ },
53
+ "routes": [
54
+ {
55
+ "pattern": "",
56
+ "name": "menu",
57
+ "target": [ "cultivarList", "MenuList" ]
58
+ },
59
+ {
60
+ "pattern": "cultivarList",
61
+ "name": "cultivarList",
62
+ "target": [ "cultivarList", "MenuList" ]
63
+ },
64
+ {
65
+ "pattern": "MCultivarList",
66
+ "name": "MCultivarList",
67
+ "target": [ "MCultivarList", "MenuList" ]
68
+ },
69
+ {
70
+ "pattern": "parentageList",
71
+ "name": "parentageList",
72
+ "target": [ "parentageList", "MenuList" ]
73
+ },
74
+ {
75
+ "pattern": "breederList",
76
+ "name": "breederList",
77
+ "target": [ "breederList", "MenuList" ]
78
+ },
79
+ {
80
+ "pattern": "notFound",
81
+ "name": "notFound",
82
+ "target": "notFound"
83
+ },
84
+ {
85
+ "pattern": "cultivar/{id}",
86
+ "name": "cultivar_detail",
87
+ "target": [ "cultivar_detail", "MenuList" ]
88
+ },
89
+ {
90
+ "pattern": "breeder/{id}",
91
+ "name": "breeder_detail",
92
+ "target": [ "breeder_detail", "MenuList" ]
93
+ },
94
+ {
95
+ "pattern": "parentage/{cultivar_id}/{ptype_id}/{parent_id}",
96
+ "name": "parentage_detail",
97
+ "target": [ "parentage_detail", "MenuList" ]
98
+ },
99
+ {
100
+ "pattern": "parentage_create_for/{cultivar_id}",
101
+ "name": "parentage_create_for",
102
+ "target": [ "parentage_create", "MenuList" ]
103
+ },
104
+ {
105
+ "pattern": "cultivar_create",
106
+ "name": "cultivar_create",
107
+ "target": [ "cultivar_create", "MenuList" ]
108
+ },
109
+ {
110
+ "pattern": "parentage_create",
111
+ "name": "parentage_create",
112
+ "target": [ "parentage_create", "MenuList" ]
113
+ },
114
+ {
115
+ "pattern": "breeder_create",
116
+ "name": "breeder_create",
117
+ "target": [ "breeder_create", "MenuList" ]
118
+ }
119
+ ],
120
+ "targets": {
121
+ "MenuList": {
122
+ "viewName": "MenuList",
123
+ "controlAggregation" : "masterPages",
124
+ "viewLevel" : 1
125
+ },
126
+ "parentageList": {
127
+ "viewName": "ParentageList",
128
+ "controlAggregation" : "detailPages",
129
+ "viewLevel" : 1
130
+ },
131
+ "cultivarList": {
132
+ "viewName": "CultivarList",
133
+ "controlAggregation" : "detailPages",
134
+ "viewLevel" : 1
135
+ },
136
+ "MCultivarList": {
137
+ "viewName": "MCultivarList",
138
+ "controlAggregation" : "detailPages",
139
+ "viewLevel" : 1
140
+ },
141
+ "breederList": {
142
+ "viewName": "BreederList",
143
+ "controlAggregation" : "detailPages",
144
+ "viewLevel" : 1
145
+ },
146
+ "cultivar_detail": {
147
+ "viewName": "Cultivar_Detail",
148
+ "controlAggregation" : "detailPages",
149
+ "viewLevel" : 2
150
+ },
151
+ "breeder_detail": {
152
+ "viewName": "Breeder_Detail",
153
+ "controlAggregation" : "detailPages",
154
+ "viewLevel" : 2
155
+ },
156
+ "cultivar_detail": {
157
+ "viewName": "Cultivar_Detail",
158
+ "controlAggregation" : "detailPages",
159
+ "viewLevel" : 2
160
+ },
161
+ "parentage_detail": {
162
+ "viewName": "Parentage_Detail",
163
+ "controlAggregation" : "detailPages",
164
+ "viewLevel" : 2
165
+ },
166
+ "cultivar_create": {
167
+ "viewName": "Cultivar_Create",
168
+ "controlAggregation" : "detailPages",
169
+ "viewLevel" : 2
170
+ },
171
+ "parentage_create": {
172
+ "viewName": "Parentage_Create",
173
+ "controlAggregation" : "detailPages",
174
+ "viewLevel" : 2
175
+ },
176
+ "cultivar_create": {
177
+ "viewName": "Cultivar_Create",
178
+ "controlAggregation" : "detailPages",
179
+ "viewLevel" : 2
180
+ },
181
+ "breeder_create": {
182
+ "viewName": "Breeder_Create",
183
+ "controlAggregation" : "detailPages",
184
+ "viewLevel" : 2
185
+ },
186
+
187
+ "notFound": {
188
+ "viewName": "NotFound",
189
+ "transition": "show"
190
+ }
191
+ }
192
+ }
193
+ }
194
+ }
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,19 @@
1
+ sap.ui.define([
2
+ "sap/ui/model/json/JSONModel",
3
+ "sap/ui/Device"
4
+ ], function (JSONModel, Device) {
5
+ "use strict";
6
+
7
+ return {
8
+
9
+ createDeviceModel : function () {
10
+ var oModel = new JSONModel(Device);
11
+ oModel.setDefaultBindingMode("OneWay");
12
+ return oModel;
13
+ }
14
+
15
+
16
+ };
17
+
18
+ }
19
+ );
@@ -0,0 +1,50 @@
1
+ <mvc:View
2
+ controllerName="vibert.controller.BreederList"
3
+ xmlns="sap.ui.table"
4
+ xmlns:mvc="sap.ui.core.mvc"
5
+ xmlns:u="sap.ui.unified"
6
+ xmlns:co="sap.ui.commons"
7
+ xmlns:c="sap.ui.core"
8
+ xmlns:m="sap.m">
9
+
10
+ <m:Toolbar class="sapUiMediumMarginTop" id="toolbar1">
11
+ <m:Button text="Create record" press="onCreatePress"/>
12
+ <m:Button text="Delete record" press="onDeletePress"/>
13
+
14
+ </m:Toolbar>
15
+
16
+ <Table id="breeder_table"
17
+ selectionMode="Single"
18
+ rowSelectionChange = "onSelectionChange"
19
+ visibleRowCount="20"
20
+ visibleRowCountMode="auto"
21
+ selectionBehavior="Row"
22
+ rows="{
23
+ path: '/breeder',
24
+ parameters: {operationMode: 'Server'}
25
+ }">
26
+ <columns>
27
+ <Column width="6%" autoResizable="true" sortProperty="id">
28
+ <m:Label text="Breeder id"/>
29
+ <template>
30
+ <m:Text text="{id}"/>
31
+ </template>
32
+
33
+ </Column>
34
+ <Column autoResizable="true" sortProperty="last_name" filterProperty="last_name">
35
+ <m:Label text="Last name"/>
36
+ <template>
37
+ <m:Text text="{last_name}"/>
38
+ </template>
39
+ </Column>
40
+ <Column autoResizable="true" sortProperty="first_name" filterProperty="first_name">
41
+ <m:Label text="First name"/>
42
+ <template>
43
+ <m:Text text="{first_name}"/>
44
+ </template>
45
+ </Column>
46
+ </columns>
47
+ </Table>
48
+
49
+
50
+ </mvc:View>
@@ -0,0 +1,21 @@
1
+ <core:FragmentDefinition
2
+ xmlns="sap.m"
3
+ xmlns:core="sap.ui.core">
4
+ <SelectDialog
5
+ title="Select breeder"
6
+ items="{
7
+ path : '/breeder',
8
+ sorter : { path: 'last_name' }
9
+ }"
10
+ search="_handleValueHelpSearch"
11
+ confirm="_handleValueHelpClose"
12
+ cancel="_handleValueHelpClose">
13
+ <StandardListItem
14
+ iconDensityAware="false"
15
+ iconInset="false"
16
+ title="{last_name} {first_name}"
17
+ description="{id}" />
18
+ </SelectDialog>
19
+ </core:FragmentDefinition>
20
+
21
+
@@ -0,0 +1,26 @@
1
+ <mvc:View
2
+ xmlns="sap.m"
3
+ xmlns:t="sap.ui.table"
4
+ xmlns:f="sap.ui.layout.form"
5
+ xmlns:mvc="sap.ui.core.mvc"
6
+ controllerName="vibert.controller.Breeder_Create" >
7
+ <Page title="Create Breeder record" showNavButton="true"
8
+ navButtonPress="onNavBack" >
9
+
10
+ <headerContent>
11
+ <Button icon="sap-icon://create" type="Accept" press="onCreate" text="Create"/>
12
+ </headerContent>
13
+
14
+
15
+ <ObjectHeader title="{id}"/>
16
+
17
+ <f:SimpleForm id="breeder_create_form" editable="true">
18
+ <Label text="First name"/>
19
+ <Input id="first_name" type="text" name="first_name" enabled="true" />
20
+ <Label text="Last name"/>
21
+ <Input id="last_name" type="text" name="last_name" enabled="true" />
22
+ </f:SimpleForm>
23
+
24
+
25
+ </Page>
26
+ </mvc:View>
@@ -0,0 +1,53 @@
1
+ <mvc:View xmlns="sap.m" xmlns:t="sap.ui.table" xmlns:f="sap.ui.layout.form" xmlns:mvc="sap.ui.core.mvc" controllerName="vibert.controller.Breeder_Detail">
2
+ <Page title="Breeder" showNavButton="true" navButtonPress="onNavBack">
3
+ <customHeader>
4
+ <Bar>
5
+ <contentLeft>
6
+ <Button icon="sap-icon://nav-back" press="onNavBack" />
7
+ <Button icon="sap-icon://save" type="Accept" press="onSave" text="Save changes" />
8
+ </contentLeft>
9
+ </Bar>
10
+ </customHeader>
11
+ <ObjectHeader title="id : {id}" />
12
+ <Panel expandable="true" expanded="true" headerText="Details" width="auto" class="sapUiResponsiveMargin">
13
+ <content>
14
+ <f:SimpleForm editable="true">
15
+ <Label text="First name" />
16
+ <Input id="first_name" type="text" name="first_name" enabled="true" value="{first_name}" />
17
+ <Label text="Last name" />
18
+ <Input id="last_name" type="text" name="last_name" enabled="true" value="{last_name}" />
19
+ </f:SimpleForm>
20
+ </content>
21
+ </Panel>
22
+ <Panel expandable="true" expanded="true" headerText="Cultivars" width="auto" class="sapUiResponsiveMargin">
23
+ <content>
24
+ <t:Table id="breeder_cultivar_table" selectionMode="Single"
25
+ rowSelectionChange="onCultivarSelectionChange"
26
+ visibleRowCount="8" visibleRowCountMode="auto"
27
+ rows="{path: 'cultivar' }"
28
+ selectionBehavior="Row">
29
+ <t:columns>
30
+ <t:Column width="6%" autoResizable="true" sortProperty="id">
31
+ <Label text="Cultivar" />
32
+ <t:template>
33
+ <Text text="{id}" />
34
+ </t:template>
35
+ </t:Column>
36
+ <t:Column autoResizable="true" sortProperty="name" filterProperty="name">
37
+ <Label text="Name" />
38
+ <t:template>
39
+ <Text text="{name}" />
40
+ </t:template>
41
+ </t:Column>
42
+ <t:Column autoResizable="true" width="8%" sortProperty="year" filterProperty="year">
43
+ <Label text="Year" />
44
+ <t:template>
45
+ <Text text="{year}" />
46
+ </t:template>
47
+ </t:Column>
48
+ </t:columns>
49
+ </t:Table>
50
+ </content>
51
+ </Panel>
52
+ </Page>
53
+ </mvc:View>
@@ -0,0 +1,58 @@
1
+ <mvc:View
2
+ controllerName="vibert.controller.CultivarList"
3
+ xmlns="sap.ui.table"
4
+ xmlns:mvc="sap.ui.core.mvc"
5
+ xmlns:u="sap.ui.unified"
6
+ xmlns:co="sap.ui.commons"
7
+ xmlns:c="sap.ui.core"
8
+ xmlns:m="sap.m">
9
+
10
+ <m:Toolbar class="sapUiMediumMarginTop" id="toolbar1">
11
+ <m:Button icon="sap-icon://create" text="Create" press="onCreatePress"/>
12
+
13
+ </m:Toolbar>
14
+
15
+ <Table id="cultivar_table"
16
+ selectionMode="Single"
17
+ rowSelectionChange = "onSelectionChange"
18
+ visibleRowCount="20"
19
+ visibleRowCountMode="auto"
20
+ selectionBehavior="Row"
21
+ rows="{
22
+ path: '/cultivar',
23
+ parameters: {expand: 'breeder',
24
+ operationMode: 'Server'}
25
+ }">
26
+ <columns>
27
+ <Column width="6%" autoResizable="true" sortProperty="ID">
28
+ <m:Label text="Cultivar"/>
29
+ <template>
30
+ <m:Text text="{id}"/>
31
+ </template>
32
+
33
+ </Column>
34
+ <Column autoResizable="true" sortProperty="name" filterProperty="name">
35
+ <m:Label text="Name"/>
36
+ <template>
37
+ <m:Text text="{name}"/>
38
+ </template>
39
+ </Column>
40
+ <Column autoResizable="true" width="8%" sortProperty="year" filterProperty="year">
41
+ <m:Label text="Year"/>
42
+ <template>
43
+ <m:Text text="{year}"/>
44
+ </template>
45
+ </Column>
46
+ <Column autoResizable="true"
47
+ sortProperty="breeder/last_name"
48
+ filterProperty="breeder/last_name">
49
+ <m:Label text="Breeder"/>
50
+ <template>
51
+ <m:Text text="{breeder/last_name} {breeder/first_name}" />
52
+ </template>
53
+ </Column>
54
+ </columns>
55
+ </Table>
56
+
57
+
58
+ </mvc:View>
@@ -0,0 +1,23 @@
1
+ <core:FragmentDefinition
2
+ xmlns="sap.m"
3
+ xmlns:core="sap.ui.core">
4
+ <SelectDialog
5
+ title="Select cultivar"
6
+ items="{path: '/cultivar',
7
+ sorter: {
8
+ path: 'year',
9
+ descending: false,
10
+ group: true }
11
+ }"
12
+ search="_handleValueHelpSearch"
13
+ confirm="_handleValueHelpClose"
14
+ cancel="_handleValueHelpClose">
15
+ <StandardListItem
16
+ iconDensityAware="false"
17
+ iconInset="false"
18
+ title="{name} / {breeder/last_name}"
19
+ description="{id}" />
20
+ </SelectDialog>
21
+ </core:FragmentDefinition>
22
+
23
+