Wednesday, 30 December 2015

difference between shell and the page in sapui5 ?

Both page and shell used the content element and the Page is showing full width for the app default when we load from the index,if we use the shell  it is taking some default alignments from left and right ,if we use the page there is no default left and right margins for the pages.

for shell ...in the index page


           <script>
var shell = new sap.m.Shell({
title : "Routing Concept",
showLogout : true,
headerRightText : "Right Text",
app : new sap.ui.core.ComponentContainer({
name : "yourprojectName"
})
})
shell.placeAt("content");

</script>




for the Page...in the index page



            <script>
sap.ui.localResources("viewfoldername");
var app = new sap.m.App({initialPage:"idSampleApp1"});
var page = sap.ui.view({id:"idSampleApp1",                viewName:"themainviewtonavigate", type:sap.ui.core.mvc.ViewType.XML});
app.addPage(page);
app.placeAt("content");
    </script>




how to get the click option for the list item or Table row in sapUi5 ?

in the columnList make sure that the type and the press

<ColumnListItem id="list"  type="Navigation"
  press="handleLineItemPress" >


in js file



handleLineItemPress : function(oEvent) {

sap.m.MessageToast.show("hello   data   "
+ oEvent.getSource().getCells()[1].getText(), {
duration : 3000
});

},

Monday, 28 December 2015

how to remove the header /Tiltle bar of the page in sap ui5 ?

use the <Page  showHeader="false" ></Page> ,if the showHeader is the False then we can hide the Title bar or Header of the Page.