SAPUI5实例一:来创建Web应用UI
试试SAPUI5。这是SAP比较重要的一个UI库。完全通过HTML5实现,可以作为Web和移动应用的UI开发。
现在已经开源了。在这里可以下载:
http://sap.github.io/openui5/
SAPUI5功能很强大,开发也很简单,包含很多组件和主题,并且是通过MVC来开发,下面简单看一下。
这里使用的是Apache Web服务器2.2.26,SAPUI5的版本为 1.18。
1.安装Apache服务器,运行。
2.将下载的sapui5包解压缩到apache服务器应用目录下,我这里是/Application/MAMP/htdocs
3.测试。
打开http://localhost:8888/sapui5/
4.创建一个static web project hellosapui5
5.创建index.html
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv='X-UA-Compatible' content='IE=edge' />
- <title>Hello World</title>
- <script id='sap-ui-bootstrap'
- src='http://localhost:8888/sapui5/resources/sap-ui-core.js'
- data-sap-ui-theme='sap_goldreflection'
- data-sap-ui-libs='sap.ui.commons, sap.ui.table'></script>
- <script>
- // create the DataTable control
- var oTable = new sap.ui.table.Table({
- editable : true
- });
- // define the Table columns
- var oControl = new sap.ui.commons.TextView({
- text : "{lastName}"
- }); // short binding notation
- oTable.addColumn(new sap.ui.table.Column({
- label : new sap.ui.commons.Label({
- text : "Last Name"
- }),
- template : oControl,
- sortProperty : "lastName",
- filterProperty : "lastName",
- width : "100px"
- }));
- oControl = new sap.ui.commons.TextField().bindProperty("value", "name"); // more verbose binding notationt
- oTable.addColumn(new sap.ui.table.Column({
- label : new sap.ui.commons.Label({
- text : "First Name"
- }),
- template : oControl,
- sortProperty : "name",
- filterProperty : "name",
- width : "80px"
- }));
- oControl = new sap.ui.commons.CheckBox({
- checked : "{checked}"
- });
- oTable.addColumn(new sap.ui.table.Column({
- label : new sap.ui.commons.Label({
- text : "Checked"
- }),
- template : oControl,
- sortProperty : "checked",
- filterProperty : "checked",
- width : "75px",
- hAlign : "Center"
- }));
- oControl = new sap.ui.commons.Link({
- text : "{linkText}",
- href : "{href}"
- });
- oTable.addColumn(new sap.ui.table.Column({
- label : new sap.ui.commons.Label({
- text : "Web Site"
- }),
- template : oControl,
- sortProperty : "linkText",
- filterProperty : "linkText"
- }));
- oControl = new sap.ui.commons.RatingIndicator({
- value : "{rating}"
- });
- oTable.addColumn(new sap.ui.table.Column({
- label : new sap.ui.commons.Label({
- text : "Rating"
- }),
- template : oControl,
- sortProperty : "rating",
- filterProperty : "rating"
- }));
- // create some local data
- var aData = [ {
- lastName : "Dente",
- name : "Al",
- checked : true,
- linkText : "www.sap.com",
- href : "http://www.sap.com",
- rating : 4
- }, {
- lastName : "Friese",
- name : "Andy",
- checked : true,
- linkText : "https://experience.sap.com/fiori",
- href : "https://experience.sap.com/fiori",
- rating : 2
- }, {
- lastName : "Mann",
- name : "Anita",
- checked : false,
- linkText : "http://www.saphana.com/",
- href : "http://www.saphana.com/",
- rating : 3
- } ];
- // create a JSONModel, fill in the data and bind the Table to this model
- var oModel = new sap.ui.model.json.JSONModel();
- oModel.setData({
- modelData : aData
- });
- oTable.setModel(oModel);
- oTable.bindRows("/modelData");
- // finally place the Table into the UI
- oTable.placeAt("content");
- </script>
- </head>
- <body class='sapUiBody'>
- <div id='content'></div>
- </body>
- </html>
6.运行结果:
小结:
这个很简单的例子展示了SAPUI5的Table控件,创建了一个table,然后将json格式的数据与之绑定,最后在页面展示。
代码很简单,界面很漂亮,很好很强大。
SAPUI5实例一:来创建Web应用UI的更多相关文章
- Web Service 实例基于Socket创建Web服务
ServerSocket服务器端代码如下: public static void main(String[] args) throws IOException { // 1:建立服务器端的tcp so ...
- maven 学习---使用Maven创建Web应用程序项目
在本教程中,我们将演示如何使用 Maven 创建一个 Java Web 项目(Spring MVC). 用到的技术/工具: Maven 3.3.3 Eclipse 4.3 JDK 8 Spring 4 ...
- 2015年最全的移动WEB前端UI框架
目前,众多互联网公司APP都嵌入了大量的HTML5,移动端的开发越来越重视,HTML5的运用场景也越来越多了.在移动WEB开发的过程中,使用合适的移动WEB UI框架可以大大提升我们的开发效率.下面P ...
- 在Salesforce中创建Web Service供外部系统调用
在Salesforce中可以创建Web Service供外部系统调用,并且可以以SOAP或者REST方式向外提供调用接口,接下来的内容将详细讲述一下用SOAP的方式创建Web Service并且用As ...
- 【ASP.NET Web API教程】2.4 创建Web API的帮助页面
原文:[ASP.NET Web API教程]2.4 创建Web API的帮助页面 注:本文是[ASP.NET Web API系列教程]的一部分,如果您是第一次看本博客文章,请先看前面的内容. 2.4 ...
- Myeclipse 创建 Web Maven项目
1.创建Web项目 添加Maven支持 2.pom.xml 报如下错误: 解决办法: pom.xml里面添加依赖: <dependency> <groupId>com.thou ...
- web前端UI框架
分类:WEB前端 时间:2016年1月13日 目前,众多互联网公司APP都嵌入了大量的HTML5,移动端的开发越来越重视,HTML5的运用场景也越来越多了.在移动WEB开发的过程中,使用合适的移动WE ...
- 使用 ASP.NET Core MVC 创建 Web API(五)
使用 ASP.NET Core MVC 创建 Web API 使用 ASP.NET Core MVC 创建 Web API(一) 使用 ASP.NET Core MVC 创建 Web API(二) 使 ...
- asyncio创建协程解析——分析廖雪峰的Python教程之创建WEB服务(转)
第一步,搭建开发环境 所需第三方库: aiohttp,异步 Web 开发框架:jinja2,前端模板引擎:aiomysql,异步 mysql 数据库驱动 所需内置库: logging,系统日志:asy ...
随机推荐
- 再也不学AJAX了!(三)跨域获取资源 ① - 同源策略
我们之前提到过,AJAX技术使开发者能够专注于互联网中数据的传输,而不再拘泥于数据传输的载体.通过AJAX技术,我们获取数据的方式变得更加灵活,可控和优雅. 但是AJAX技术并不是一把万能钥匙,互联网 ...
- Hive的执行生命周期
1.入口$HIVE_HOME/bin/ext/cli.sh 调用org.apache.hadoop.hive.cli.CliDriver类进行初始化过程 处理-e,-f,-h等信息,如果是-h,打印提 ...
- MR案例:分区和排序
现有一学生成绩数据,格式如下:<学号,姓名,学院,成绩> //<id, name, institute, grade>. 需求描述:查询成绩大于等于60分的学生数据,按学院分 ...
- rhel7配置samba_4.7.1,共享给所有人以及共享给指定用户
1.共享给所有人 服务端配置: yum -y install samba samba-client samba-common #安装客户端 mkdir /guest #创建共享文件夹 c ...
- Spring @Scheduler使用cron时的执行问题
主要想弄清使用Spring @Scheduler cron表达式时的两个问题: 同一定时任务,第二次触发时间到了,第一次还没有执行完成时会执行吗? 不同的定时任务,相互之间是否有影响? 结论写在前面: ...
- linux 忘记登陆密码
声明:如果不是远程登陆,机器在自己身边还有救. 第一步:重启机器,进入brug界面(grub是一个引导管理程序,可以引导linux.winxp等系统,在/boot/grub/中的menu.lst中进行 ...
- ContOs 将SpringBoot的jar制作成系统服务
将jar包上传到 你想要的目录下 如 /java/service/demo.jar 进入 /etc/systemd/system 目录下 新建 demo.service 内容如下 -------- ...
- 自学Java测试代码二String, StringBuffer
2017-08-23 10:38:01 writer:pprp package test; import java.util.*; public class test2 { public static ...
- LightOJ 1341 Aladdin and the Flying Carpet(唯一分解定理)
http://lightoj.com/volume_showproblem.php?problem=1341 题意:给你矩形的面积(矩形的边长都是正整数),让你求最小的边大于等于b的矩形的个数. 思路 ...
- mongodb禁止外网访问以及添加账号
未曾料到被黑客勒索比特币的戏码竟然降临到我的身上,几个月的技术积累付之一炬.怪只怪自己学艺不精,心存侥幸和无知,不过经此一役,方知网络安全防护的重要性. 一直未给自己的mongodb数据库设置账号密码 ...