Skip to content

Commit

Permalink
Add detail pages to FlexibleColumnLayout and enable routing
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Jun 8, 2017
1 parent a78a26f commit 1e1ca9e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions webapp/controller/Master.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ sap.ui.define([
},
onToggleFooter: function () {
this.getPage().setShowFooter(!this.getPage().getShowFooter());
},
handleItemPress: function (oEvent) {
var sId = oEvent.getParameter("id"),
oSelectedItem = sap.ui.getCore().byId(sId),
oModel = oSelectedItem.getModel(),
sPath = oSelectedItem.getBindingContextPath(),
oData = oModel.getProperty(sPath);

this.getRouter().navTo("detailName", {"detail-item": oData.ProductId});
},
getRouter: function () {
return sap.ui.core.UIComponent.getRouterFor(this);
}
});
});
2 changes: 1 addition & 1 deletion webapp/view/Detail.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
xmlns="sap.m"
displayBlock="true"
height="100%">
<Button text="Test" press="handlePress"/>
<Button text="Go To Next Page" press="handlePress"/>
</mvc:View>
2 changes: 1 addition & 1 deletion webapp/view/DetailDetail.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
xmlns="sap.m"
displayBlock="true"
height="100%">
<Text text="The end"/>
<Text text="Last Page"/>
</mvc:View>
2 changes: 1 addition & 1 deletion webapp/view/Master.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</Column>
</columns>
<items>
<ColumnListItem vAlign="Middle">
<ColumnListItem vAlign="Middle" type="Navigation" press="handleItemPress">
<cells>
<ObjectIdentifier title="{Name}" text="{ProductId}"/>
<Text text="{Category}"/>
Expand Down

0 comments on commit 1e1ca9e

Please sign in to comment.