1. 程式人生 > 其它 >SAPUI5 Walkthrough Step 11: Pages and Panels

SAPUI5 Walkthrough Step 11: Pages and Panels

https://sapui5.hana.ondemand.com/#/topic/3b9d9f84930d43df90ad0789d99bd4a3

為了使頁面更加美觀,可以增加Panel控制元件,對資料進行分組。

修改webapp/view/App.view.xml,增加Panel的使用(在這裡我們發現sapui5中,有的元件是大寫字母開頭,有的都是小寫字母。小寫字母表示該元件是一個聚合元件,裡面可以放置多個其他元件,如pages元件

<mvc:View controllerName="sap.ui.demo.walkthrough.controller.App" xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m"> <App> <pages> <Page title="{i18n>title}"> <content> <Panel headerText="{i18n>helloPanelTitle}"> <content>
<Button text="{i18n>showHelloButtonText}" press=".onShowHello"/> <Input value="{jsonModel>/recipient/name}" description="Hello {jsonModel>/recipient/name}" valueLiveUpdate
="true" width="50%"/> </content> </Panel> </content> </Page> </pages> </App> </mvc:View>

修改 webapp/i18n/i18n.properties

# App Descriptor
appTitle=Hello World
appDescription=A simple walkthrough app that explains the most important concepts of SAPUI5

showHelloButtonText=說點啥
helloMsg=說 {0}
homePageTitle=Walkthrough
helloPanelTitle=Hello World

執行