私は、クラウドベースのSAP Webideツールを使用してHCPに展開されたsapui5従業員退職アプリケーションを開発するビジネス要件を持っています。従業員のcontroller.xmlのsapui5アプリケーションURLから値を取得するには
二種類のパラメータのいずれかのIT 'または「BPO」を持つ2つの異なるURLを使ってこのアプリケーションにアクセスします:
https://webidetesting453789-inf98834.dispatcher.int.sap.hana.ondemand.com/webapp/index.html#/IT
https://webidetesting453789-inf98834.dispatcher.int.sap.hana.ondemand.com/webapp/index.html#/BPO
バックエンド:私は私の従業員の詳細を与えているRESTサービスを開発しています
/irc.com/ircit/empleave/rest/empleave/item/requestor/IT
または
/irc.com/ircit/empleave/rest/empleave/item/requestor/BPO
:JSONフォーマット私はどちらかのようなITやBPO特定の従業員については、次のURLを使用してGET要求を行うとき
閲覧: 私はXML形式のビューMyRequestListを使用しています。これは、ITとBPOの両方の要求を表形式で表示します。
要件:
私は以下のURLにユーザーがクリック、MyRequestViewのタイトルは従業員だけITに対する要求ITであるべきときurl.For例に渡されたパラメータに基づいてデータをフェッチする必要があります従業員はBPOに登場し、同じでなければなりません。
https://webidetesting453789-inf98834.dispatcher.int.sap.hana.ondemand.com/webapp/index.html#/IT
質問:
アプリケーションURLからパラメータ「IT」や「BPO」を取得し、コントローラからビューに渡す方法。
Jquery.sap.GetURIParameter.Get( "MyParam")は、 'IT'または 'BPO'というURLパラメータを取得していません。どのメソッドを使用する必要がありますか。
RouterConfig:
{
"_version": "1.1.0",
"sap.app": {
"_version": "1.1.0",
"id": "ircit.irc",
"type": "application",
"i18n": "/webapp/i18n/i18n.properties",
"title": "{{appTitle}}",
"description": "{{appDescription}}",
"applicationVersion": {
"version": "1.0.0"
}
},
"sap.ui": {
"_version": "1.1.0",
"technology": "UI5",
"deviceTypes": {
"desktop": true,
"tablet": false,
"phone": false
},
"supportedThemes": [
"sap_bluecrystal"
]
},
"sap.ui5": {
"_version": "1.1.0",
"rootView": "ircit.irc.view.App",
"dependencies": {
"minUI5Version": "1.30",
"libs": {
"sap.m": {}
}
},
"contentDensities": {
"compact": true,
"cozy": true
},
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "ircit.irc.i18n.i18n"
}
}
},
"resources": {
"css": [
{
"uri": "/webapp/css/style.css"
}
]
},
"routing": {
"config": {
"routerClass": "ircit.generic.utils.CustomRouter",
"viewType": "XML",
"viewPath": "ircit.irc.view",
"controlId": "app",
"fullWidth": true,
"controlAggregation": "pages",
"bypassed": {
"target": [
"notFound"
]
}
},
"routes": [
/*{
"pattern": "",
"name": "myRequests",
"target": "myRequests"
},*/
{
"pattern": "/{id}",
"name": "myRequests",
"target": "myRequests"
},
{
"pattern": "/create",
"name": "create",
"target": "create"
},
{
"pattern": "/create/{id}",
"name": "copy",
"target": "create"
},
{
"pattern": "/id={id}",
"name": "Display",
"target": "display"
}
],
"targets": {
"myRequests": {
"viewName": "MyRequests",
"viewId": "myRequests",
"viewLevel": 1
},
"display": {
"viewName": "Display",
"viewId": "display",
"viewLevel": 2
},
"create": {
"viewName": "Create",
"viewId": "create",
"viewLevel": 2
},
"copy": {
"viewName": "Create",
"viewId": "create",
"viewLevel": 2
},
"notFound": {
"viewName": "NotFound",
"viewId": "notFound"
}
}
}
},
"sap.platform.hcp": {
"uri": "webapp",
"_version": "1.1.0"
}
}
MyRequestController:
onInit: function() {
// set create option (cteate and copy button)
var bValue = jQuery.sap.getUriParameters().get("showCreate");
var oBtn = this.byId("btnCreate");
oBtn.setVisible(bValue !== "false");
var oColumn = this.byId("colCopy");
oColumn.setVisible(bValue !== "false");
this.getRouter().attachRouteMatched(jQuery.proxy(this.onRouteMatched, this));
},
ルーターの設定を貼り付けてください。また、ハッシュベースのルーティングを使用している場合は、メソッドを調べることもできます。attachPatternMatched(https://help.sap.com/saphelp_uiaddon20/helpdata/en/23/66345a94f64ec1a80f9d9ce50a59ef/content.htm) –