Last active
August 29, 2015 13:56
-
-
Save mitsuruog/9079112 to your computer and use it in GitHub Desktop.
Hello SAPUI5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="SAPUI5でHello world" /> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<title>Hello SAPUI5</title> | |
<script id="sap-ui-bootstrap" type="text/javascript" | |
src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js" | |
data-sap-ui-theme="sap_bluecrystal" | |
data-sap-ui-libs="sap.ui.commons,sap.m"></script> | |
<script> | |
//アプリケーションの土台を作成します | |
//ちなみにSinglePageApplicationですので画面遷移しません | |
var app = new sap.m.App("myApp", { | |
initialPage: "page1" | |
}); | |
//1ページ目を作成します | |
var page1 = new sap.m.Page("page1", { | |
title: "1ページ目", | |
showNavButton: false, | |
//ページのコンテンツはボタン1つのみです | |
content: new sap.m.Button({ | |
text: "次のページ", | |
press: function() { | |
//ボタンがタップされた場合に、次のページへ遷移します。 | |
app.to("page2"); | |
} | |
}) | |
}); | |
//2ページ目を作成します | |
var page2 = new sap.m.Page("page2", { | |
title: "2ページ目", | |
//ページ左上に戻るボタンを表示します | |
showNavButton: true, | |
//戻るボタンをタップした場合のイベントハンドラです | |
navButtonPress: function() { | |
//前のページに戻ります | |
app.back(); | |
}, | |
//ページのコンテンツはラベル1つのみです | |
content: new sap.m.Label({ | |
text: "Hello SAPUI5 Mobile World!" | |
}) | |
}); | |
//アプリケーションにページを追加します | |
app.addPage(page1).addPage(page2); | |
//HTMLの所定の場所にアプリケーションを追加します | |
app.placeAt("content"); | |
</script> | |
</head> | |
<body class="sapUiBody" id="content"></body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment