阅读 166

SAP UI5 使用 Smart Control 的一个具体例子

SAP UI5 使用 Smart Control 的一个具体例子

我们在本地 Visual Studio Code 里, 按照下面两篇文章,完成了 SAP UI5 的应用开发,

  • 使用 yo 命令行向导创建 SAP UI5 应用

  • 使用 yo 命令行向导给 SAP UI5 应用添加一个新的视图

最后能得到一个列表,效果如下:

本文我们使用 SAP UI5 提供的 Smart 控件来继续丰富这个应用。

从下面三个 namespace 引入 Smart 控件:

  • xmlns:smartFilterBar="sap.ui.comp.smartfilterbar"

  • xmlns:smartList="sap.ui.comp.smartlist"

  • xmlns:smartTable="sap.ui.comp.smarttable"

xml view 的实现源代码:

<mvc:View controllerName="tutorial.products.controller.Products" displayBlock="true"xmlns="sap.m"xmlns:smartFilterBar="sap.ui.comp.smartfilterbar"xmlns:smartList="sap.ui.comp.smartlist"xmlns:smartTable="sap.ui.comp.smarttable"xmlns:mvc="sap.ui.core.mvc"><Page id="Products">
  <smartFilterBar:SmartFilterBar id="smartFilterBar" persistencyKey="UniqueAndStablePersistencyKey" entitySet="Products" considerSelectionVariants="true" />
  <smartList:SmartList id="smartProductList" smartFilter="smartFilterBar" entitySet="Products" expandFields="Category" header="Products List" showRowCount="true" showFullScreenButton="true" enableAutoBinding="true">
    <smartList:listItemTemplate>
      <StandardListItem id="listTemplate" type="Navigation" press="handleListItemPress" title="{ProductName}" info="{= ${UnitPrice} + ' €' }" description="{Category/CategoryName}" />
    </smartList:listItemTemplate>
  </smartList:SmartList></Page></mvc:View>

npm run start 启动工
程,最后看到的 Smart List:

Smart Filter 控件提供的开箱即用的功能:

更多Jerry的原创文章,尽在:"汪子熙":


文章分类
后端
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐