0

这是我的项目级别页面,其中有两个 Keys Request ID , Profile ID

通过选择项目并按下Edit按钮,我应该显示带有数据的编辑页面。

在此处输入图像描述

Edit Button新闻代码

this.getRouter().getTargets().display("CreateCandidate", {
            mode: "update",
            objectPath: sObjectPath
        });

我来了

sObjectPath = "ZRECRUITMENT_CANDIDATESet(RegNo=1,ProId=1)"

我的 清单.json

"CreateCandidate":{
                "viewName": "CreateCandidate",
                "viewId": "cand_creation",
                "viewLevel":2
            },

edit页面中,我应该绑定FORM什么以及应该是我的编辑页面的模式 URL。

对于标题行,我们将给出ZENTITY_SET/1一种。

但是如果我们有两个键,我们将如何给出 Pattern 。是这样ZENTITY_SET/1/2吗?请指导我这件事

我的 ODATA 读取查询:

/sap/opu/odata/SAP/ZRECRUITMENT_TRACKER_APP_SRV/
ZRECRUITMENT_CANDIDATESet(RegNo=1,ProId=2)?$format=xml

我的 OData 响应:

<?xml version="1.0" encoding="UTF-8"?>
-
<entry
	xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xml:base="http://ttpl001.truspeq.com:8000/sap/opu/odata/SAP/ZRECRUITMENT_TRACKER_APP_SRV/"
	xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
	xmlns="http://www.w3.org/2005/Atom">
	<id>http://ttpl001.truspeq.com:8000/sap/opu/odata/SAP/ZRECRUITMENT_TRACKER_APP_SRV/ZRECRUITMENT_CANDIDATESet(RegNo=1,ProId=1)</id>
	<title type="text">ZRECRUITMENT_CANDIDATESet(RegNo=1,ProId=1)</title>
	<updated>2018-07-19T20:09:00Z</updated>
	<category scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" term="ZRECRUITMENT_TRACKER_APP_SRV.ZRECRUITMENT_CANDIDATE"/>
	<link title="ZRECRUITMENT_CANDIDATE" href="ZRECRUITMENT_CANDIDATESet(RegNo=1,ProId=1)" rel="self"/>
	<link title="TOSALESDATA" type="application/atom+xml;type=entry" href="ZRECRUITMENT_CANDIDATESet(RegNo=1,ProId=1)/TOSALESDATA" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/TOSALESDATA"/>-
	<content type="application/xml">-
		<m:properties>
			<d:RegNo>1</d:RegNo>
			<d:ProId>1</d:ProId>
			<d:NameOfCan>ROCKY</d:NameOfCan>
			<d:Exp>4 YEAR</d:Exp>
			<d:CurrentCtc>45000</d:CurrentCtc>
			<d:ExpCtc>750000</d:ExpCtc>
			<d:NoticePeriod>3 MONTH</d:NoticePeriod>
			<d:CurrentLoc>KOLKATA</d:CurrentLoc>
			<d:CurrentCom>TCS</d:CurrentCom>
			<d:PassportDet>HHHWWQQ77</d:PassportDet>
			<d:PhoneNum>77778585</d:PhoneNum>
			<d:Email>ROCKYKUMAR@TCS.COM</d:Email>
			<d:SkypeId>7745</d:SkypeId>
		</m:properties>
	</content>
</entry>

4

2 回答 2

2

请参阅 此处配置路由器的文档

在 manifest.json 中:

...
"routes" : [
    {
        name: "createCandidate",
        pattern: "create/{RegNo}-{ProId}",
        target: "CreateCandidate"
    }
],
"targets": {
    "CreateCandidate": {
        "viewName": "CreateCandidate",
        "viewLevel": 2
},
....

然后导航到该视图:

oRouter.navTo("createCandidate", {
    RegNo: 1
    ProId: 1
})

然后在 CreateCandidate 控制器中

_onPatternMatched: function(oEvent) {
    // get the params RegNo and ProId from the event object - {RegNo: 1, ProId: 1}
    var oArgs = oEvent.getParameter("arguments"); 

    //use the ODataModel to create a binding path from the values
    var sBindingPath = this.getView().getModel().createKey("/ZRECRUITMENT_CANDIDATESet", oArgs);

    //Bind your view to the binding path
    this.getView().bindElement(sBindingPath); 
}

onInit: function() {
     //get the route object from the router
     var oRoute = this.getOwnerComponent().getRouter().getRoute("createCandiate");

     //attach an event to the route which is fired when the route pattern is matched
     oRoute.attachPatternMatched(this._onPatternMatched, this);
}
于 2018-07-20T19:00:08.570 回答
1

你使用 ob_start(ob_gzhandler) 函数吗?如果是这样并且如果您在 ob_start(ob_gzhandler) 函数上方输出任何内容,您将收到此错误。您可以不使用该功能,也可以不输出高于该功能的内容。ob_gzhandler 回调函数将确定浏览器将接受哪种类型的内容编码,并将相应地返回其输出。因此,如果您在此函数上方输出内容,则内容的编码可能与 ob_gzhandler 的输出内容不同,从而导致此错误。

于 2018-08-04T06:08:04.940 回答