日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

發布時間:2023/12/19 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 使用 yo 命令行向导给 SAP UI5 应用添加一个新的视图 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

在 使用 yo 創建好的 SAP UI5 項目里,使用命令行:

yo easy-ui5 project newview:

輸入新的視圖名稱為 Products,創建新的控制器,以及在 manifest.json 里定義新的 route:

manifest.json routing 區域里三個節點增添了新屬性:

target 區域增添了新的 id 和 name 同名的Products 視圖,實現類型為 XML:

把 pattern 里字符串內容去掉,變成"":

webapp/view/Mainview.view.xml 是整個應用的外層容器。將 app 標簽頁里的內容全部刪除:

創建出來的 Products 頁面的內容為:

<mvc:View controllerName="tutorial.products.controller.Products" displayBlock="true"xmlns="sap.m"xmlns:mvc="sap.ui.core.mvc"><Page id="Products" title="Available Products"><content><List items="{/Products}"><StandardListItem type="Active" title="{ProductName}" /></List></content></Page> </mvc:View>

使用 aggregation bindings,定義了一個 list.

使用命令行 yo easy-ui5 project newmodel 創建一個新模型:

所有到 data source 的數據請求,都會被發送到這個 url:

/V2/Northwind/Northwind.svc/.

Modify the uimodule/webapp/xsapp.json file to redirect the traffic to a destination.

修改 xsapp.json, 將請求重新路由到 destination.

{"welcomeFile": "/flpSandbox.html","routes": [{"source": "^/V2/(.*)$","authenticationType": "none","destination": "Northwind","csrfProtection": false},{"source": "^(.*)","target": "$1","authenticationType": "xsuaa","service": "html5-apps-repo-rt"}] }

You already created a destination named Northwind in Cloud Foundry environment of SAP BTP. Now it’s time to add a mocked destination to your local setup as well.

在 uimodule 文件夾下面的 ui5.yaml 文件里:

定義一個本地 destination:

使用 npm ui5 啟動工程。

最后的效果:

更多Jerry的原創文章,盡在:“汪子熙”:

總結

以上是生活随笔為你收集整理的使用 yo 命令行向导给 SAP UI5 应用添加一个新的视图的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。