分屏式生根,出现详细错误帮助

2020-09-20 07:05发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)大家好! ...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


大家好!

我想导航到带有详细信息的拆分屏幕,并且希望在拆分屏幕上显示详细信息。

导航到分屏的效果很好,但不会传输详细信息。

有人可以帮助我吗?

谢谢。

马特。

下面的代码。

//Worklist.controller.js
//我的导航方式


 onPress:函数(oEvt){
 this.getRouter()。navTo(" Detail",{
 detailProductPath:oEvt.getSource()。getBindingContext()。getProperty(" PostID")
 });
 },
 
//Detail.controller.js


 sap.ui.define([
 'sap/ui/demo/bulletinboard/controller/BaseController',
 'sap/ui/model/json/JSONModel',
 'sap/ui/demo/bulletinboard/model/formatter'
 ],函数(BaseController,JSONModel,格式化程序){
 "使用严格";

 return BaseController.extend(" sap.ui.demo.bulletinboard.controller.Detail",{


 格式化程序:formatter,

 onInit:函数(){
 var oViewModel = new JSONModel({
 忙碌:错误
 });
 this.getRouter()。getRoute(" detail")。attachPatternMatched(this._onPostMatched,this);
 this.setModel(oViewModel," postView");
 },

 _onPostMatched:函数(oEvent){
 var oViewModel = this.getModel(" postView"),
 oDataModel = this.getModel();
 this.getView()。bindElement({
 路径:"/img/Posts('" + oEvent.getParameter(" arguments")。postId +"')",

 事件:{
 dataRequested:function(){
 oDataModel.metadataLoaded()。then(function(){
 oViewModel.setProperty("/img/busy",true);
 });
 },
 dataReceived:function(){
 oViewModel.setProperty("/img/busy",false);
 }
 }
 });
 }
 });
 });
 
//Detail.view.xml


 

 
 <页面>
 <页面>
 <内容>
 
 <平铺>
 
 
 
 <内容>
 <新闻内容
 contentText ="描述:{描述}"
 subheader =" {
 路径:"价格",
 格式化程序:"。formatter.financingPossibility"
 }">
 
 
 
 
 
 
 
 
 
 
 

 
//manifest.json



 "路由":{
 " config":{
 " routerClass":" sap.m.routing.Router",
 " viewType":" XML",
 " viewPath":" sap.ui.demo.bulletinboard.view",
 " targetAggregation":"页面",
 "异步":true
 },
 "路线":[
 {
 " pattern":"",
 " name":" home",
 " view":" Home",
 " targetAggregation":"页面",
 " controlId":" app"
 },
 {
 " pattern":"工作清单",
 " name":"工作清单",
 " view":"工作清单",
 " targetAggregation":"页面",
 " controlId":" app"

 },
 {" pattern":" Split",
 " name":" Splitapp",
 " view":" Splitapp",
 " targetAggregation":"页面",
 " controlId":" app",

 " subroutes":[{" pattern":" Split",
 " name":" Master",
 " view":" Master",
 " targetAggregation":" masterPages",
 " targetControl":" splitapp",

 "子路线":[{
 "模式":"拆分/{detailProductPath}","名称":"详细信息",
 "查看详情",
 " targetAggregation":" detailPages"
 }]
 }]
 }
 ]


 }
 
5条回答

请尝试以下。

 onPress:function(oItem){
 console.info(oItem);
 this.getOwnerComponent()。getRouter()。navTo(" detail",{
 productId:oItem.getBindingContext(" modelname")。getProperty(" ProductID")
 });
 }
 
 onInit:function(){
 var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
 oRouter.getRoute(" detail")。attachMatched(this._onRouteMatched,this);
 },
 _onRouteMatched:function(oEvent){
 var oView;
 oView = this.getView();
 oView.bindElement({
 路径:"/img/Products(" + oEvent.getParameter(" arguments")。productId +")",
 型号:"产品",
 参数:{
 展开:"供应商"
 },
 事件:{
 dataRequested:function(oEvent){
 oView.setBusy(true);
 },
 dataReceived:function(oEvent){
 console.info("问题详细");
 oView.setBusy(false);
 }
 }
 });
 },
 

一周热门 更多>