<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>

		<script src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
				id="sap-ui-bootstrap"
				data-sap-ui-libs="sap.m"
				data-sap-ui-theme="sap_bluecrystal" 
				data-sap-ui-xx-bindingSyntax="complex"
	    	data-sap-ui-resourceroots='{
				"sap.demo": "./"
			}'>
		</script>
		<!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme -->

		<script>
			
				var app = new sap.m.App({initialPage:"idsample1"});
				var page = sap.ui.view({id:"idsample1", viewName:"sap.demo.sample", type:sap.ui.core.mvc.ViewType.JS});
				app.addPage(page);
				app.placeAt("content");
		</script>

	</head>
	<body class="sapUiBody" role="application">
		<div id="content"></div>
	</body>
</html>
// Code goes here

/* Styles go here */

sap.ui.jsview("sap.demo.sample", {

	/** Specifies the Controller belonging to this View. 
	* In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.
	* @memberOf linebreal.sample
	*/ 
	getControllerName : function() {
		return "sap.demo.sample";
	},

	/** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed. 
	* Since the Controller is given to this method, its event handlers can be attached right away. 
	* @memberOf linebreal.sample
	*/ 
	createContent : function(oController) {
 		
		var oInput = new sap.m.TextArea('input1');
	
		oInput.placeAt("content");
		
	}

});
sap.ui.controller("sap.demo.sample", {

/**
* Called when a controller is instantiated and its View controls (if available) are already created.
* Can be used to modify the View before it is displayed, to bind event handlers and do other one-time initialization.
* @memberOf linebreal.sample
*/
	onInit: function() {
		var adata = [{name : "sap"},{name : "scn"},{name : "community"}]
		var notes = "";
 		for(var i = 0;i<adata.length;i++)
 			{
 			notes = notes+adata[i].name + "\n"
 			}
 		console.log(notes);
 		sap.ui.getCore().byId("input1").setValue(notes)
 		
	},

/**
* Similar to onAfterRendering, but this hook is invoked before the controller's View is re-rendered
* (NOT before the first rendering! onInit() is used for that one!).
* @memberOf linebreal.sample
*/
//	onBeforeRendering: function() {
//
//	},

/**
* Called when the View has been rendered (so its HTML is part of the document). Post-rendering manipulations of the HTML could be done here.
* This hook is the same one that SAPUI5 controls get after being rendered.
* @memberOf linebreal.sample
*/
//	onAfterRendering: function() {
//
//	},

/**
* Called when the Controller is destroyed. Use this one to free resources and finalize activities.
* @memberOf linebreal.sample
*/
//	onExit: function() {
//
//	}

});