Hi All,
I am a beginner to SAPUI5 and I am just trying to experience themes. I have created a project using MVC and in the view.js file, I have written the following code.
createContent : function(oController)
{
var oMatrix = new sap.ui.commons.layout.MatrixLayout({id : "matrix1",
layoutFixed : false,
});
var oBut_golden = new sap.ui.commons.Button();
oBut_golden.setText("Golden Reflection");
oBut_golden.setWidth(400);
oBut_golden.attachPress(oController.golden);
var oBut_blue = new sap.ui.commons.Button();
oBut_blue.setText("BlueCrystal");
oBut_blue.attachPress(oController.blue);
var oBut_plat = new sap.ui.commons.Button();
oBut_plat.setText("Platinum");
oBut_plat.attachPress(oController.platinum);
var oBut_hcb = new sap.ui.commons.Button();
oBut_hcb.setText("SAP_HCB");
oBut_hcb.attachPress(oController.hcb);
oMatrix.createRow(oBut_golden,oBut_platinum,oBut_blue,oBut_hcb);
// oMatrix.placeAt('content');
return oMatrix;
}
I have not added anything in the index file as nothing need to be used with 'placeAt' method in the view as it is MVC.
But I am getting a blank page while executing the index file.
});
Appreciate your valuable inputs.
Thanks & Regards
Sunil
createContent : function(oController) { var oMatrix = new sap.ui.commons.layout.MatrixLayout({id : "matrix1", layoutFixed : false, }); var oBut_golden = new sap.ui.commons.Button(); oBut_golden.setText("Golden Reflection"); oBut_golden.setWidth(400); oBut_golden.attachPress(oController.golden); var oBut_blue = new sap.ui.commons.Button(); oBut_blue.setText("BlueCrystal"); oBut_blue.attachPress(oController.blue); var oBut_plat = new sap.ui.commons.Button(); oBut_plat.setText("Platinum"); oBut_plat.attachPress(oController.platinum); var oBut_hcb = new sap.ui.commons.Button(); oBut_hcb.setText("SAP_HCB"); oBut_hcb.attachPress(oController.hcb); oMatrix.createRow(oBut_golden,oBut_platinum,oBut_blue,oBut_hcb);// oMatrix.placeAt('content'); return oMatrix; }
});