从表中获取行

2020-08-18 02:28发布

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

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


嗨!

我想要一行并放入对象标题。

这是我的对象标题

 
 <属性>
 
 
 
 
 

我在表中选择一行,并希望将此行放入对象标题

现在,我通过这种方式从表中获取数据到对象标头下面的这个标签...但是我不知道如何从表中获取对象标头。

 var oSelectedItem = oEvent.getParameter(" listItem")||  oEvent.getSource()。getSelectedItem()。getBindingContext();


 var s1t = oSelectedItem.getBindingContext()。getProperty(" Status01Text");
 var oText = this.getView()。byId(" s1t");
 oText.setText(s1t);
//Status01
 var s1 = oSelectedItem.getBindingContext()。getProperty(" Status01");
 var oText = this.getView()。byId(" s1");
 oText.setText(s1);


 var s1p = oSelectedItem.getBindingContext()。getProperty(" Status01Perc");
 var oText = this.getView()。byId(" s1p");
 oText.setText(s1p);
//状态02
 var s2t = oSelectedItem.getBindingContext()。getProperty(" Status02Text");
 var oText = this.getView()。byId(" s2t");
 oText.setText(s2t);


 var s2 = oSelectedItem.getBindingContext()。getProperty(" Status02");
 var oText = this.getView()。byId(" s2");
 oText.setText(s2);


 var s2p = oSelectedItem.getBindingContext()。getProperty(" Status02Perc");
 var oText = this.getView()。byId(" s2p");
 oText.setText(s2p);
//状态03
 var s3t = oSelectedItem.getBindingContext()。getProperty(" Status03Text");
 var oText = this.getView()。byId(" s3t");
 oText.setText(s3t);


 var s3 = oSelectedItem.getBindingContext()。getProperty(" Status03");
 var oText = this.getView()。byId(" s3");
 oText.setText(s3);


 var s3p = oSelectedItem.getBindingContext()。getProperty(" Status03Perc");
 var oText = this.getView()。byId(" s3p");
 oText.setText(s3p);


//status04


 var s4t = oSelectedItem.getBindingContext()。getProperty(" Status04Text");
 var oText = this.getView()。byId(" s4t");
 oText.setText(s4t);


 var s4 = oSelectedItem.getBindingContext()。getProperty(" Status04");
 var oText = this.getView()。byId(" s4");
 oText.setText(s4);


 var s4p = oSelectedItem.getBindingContext()。getProperty(" Status04Perc");
 var oText = this.getView()。byId(" s4p");
 oText.setText(s4p);


//Status05


 var s5t = oSelectedItem.getBindingContext()。getProperty(" Status05Text");
 var oText = this.getView()。byId(" s5t");
 oText.setText(s5t);


 var s5 = oSelectedItem.getBindingContext()。getProperty(" Status05");
 var oText = this.getView()。byId(" s5");
 oText.setText(s5);


 var s5p = oSelectedItem.getBindingContext()。getProperty(" Status05Perc");
 var oText = this.getView()。byId(" s5p");
 oText.setText(s5p);


//状态06


 var s6t = oSelectedItem.getBindingContext()。getProperty(" Status06Text");
 var oText = this.getView()。byId(" s6t");
 oText.setText(s6t);


 var s6 = oSelectedItem.getBindingContext()。getProperty(" Status06");
 var oText = this.getView()。byId(" s6");
 oText.setText(s6);


 var s6p = oSelectedItem.getBindingContext()。getProperty(" Status06Perc");
 var oText = this.getView()。byId(" s6p");
 oText.setText(s6p);
 

(87.0 kB)

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

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


嗨!

我想要一行并放入对象标题。

这是我的对象标题

 
 <属性>
 
 
 
 
 

我在表中选择一行,并希望将此行放入对象标题

现在,我通过这种方式从表中获取数据到对象标头下面的这个标签...但是我不知道如何从表中获取对象标头。

 var oSelectedItem = oEvent.getParameter(" listItem")||  oEvent.getSource()。getSelectedItem()。getBindingContext();


 var s1t = oSelectedItem.getBindingContext()。getProperty(" Status01Text");
 var oText = this.getView()。byId(" s1t");
 oText.setText(s1t);
//Status01
 var s1 = oSelectedItem.getBindingContext()。getProperty(" Status01");
 var oText = this.getView()。byId(" s1");
 oText.setText(s1);


 var s1p = oSelectedItem.getBindingContext()。getProperty(" Status01Perc");
 var oText = this.getView()。byId(" s1p");
 oText.setText(s1p);
//状态02
 var s2t = oSelectedItem.getBindingContext()。getProperty(" Status02Text");
 var oText = this.getView()。byId(" s2t");
 oText.setText(s2t);


 var s2 = oSelectedItem.getBindingContext()。getProperty(" Status02");
 var oText = this.getView()。byId(" s2");
 oText.setText(s2);


 var s2p = oSelectedItem.getBindingContext()。getProperty(" Status02Perc");
 var oText = this.getView()。byId(" s2p");
 oText.setText(s2p);
//状态03
 var s3t = oSelectedItem.getBindingContext()。getProperty(" Status03Text");
 var oText = this.getView()。byId(" s3t");
 oText.setText(s3t);


 var s3 = oSelectedItem.getBindingContext()。getProperty(" Status03");
 var oText = this.getView()。byId(" s3");
 oText.setText(s3);


 var s3p = oSelectedItem.getBindingContext()。getProperty(" Status03Perc");
 var oText = this.getView()。byId(" s3p");
 oText.setText(s3p);


//status04


 var s4t = oSelectedItem.getBindingContext()。getProperty(" Status04Text");
 var oText = this.getView()。byId(" s4t");
 oText.setText(s4t);


 var s4 = oSelectedItem.getBindingContext()。getProperty(" Status04");
 var oText = this.getView()。byId(" s4");
 oText.setText(s4);


 var s4p = oSelectedItem.getBindingContext()。getProperty(" Status04Perc");
 var oText = this.getView()。byId(" s4p");
 oText.setText(s4p);


//Status05


 var s5t = oSelectedItem.getBindingContext()。getProperty(" Status05Text");
 var oText = this.getView()。byId(" s5t");
 oText.setText(s5t);


 var s5 = oSelectedItem.getBindingContext()。getProperty(" Status05");
 var oText = this.getView()。byId(" s5");
 oText.setText(s5);


 var s5p = oSelectedItem.getBindingContext()。getProperty(" Status05Perc");
 var oText = this.getView()。byId(" s5p");
 oText.setText(s5p);


//状态06


 var s6t = oSelectedItem.getBindingContext()。getProperty(" Status06Text");
 var oText = this.getView()。byId(" s6t");
 oText.setText(s6t);


 var s6 = oSelectedItem.getBindingContext()。getProperty(" Status06");
 var oText = this.getView()。byId(" s6");
 oText.setText(s6);


 var s6p = oSelectedItem.getBindingContext()。getProperty(" Status06Perc");
 var oText = this.getView()。byId(" s6p");
 oText.setText(s6p);
 

(87.0 kB)
付费偷看设置
发送
2条回答
ZJXianG
1楼-- · 2020-08-18 02:43

您好克里斯蒂娜

我不明白您的确切要求, 但我认为您正在询问如何从表的选定记录中获取数据并附加到对象标头(假设对象标头与表位于同一视图中)。 对于sap.m.table,有一个event selectionChange(调用onRecordSelection函数处理程序),您需要使用该事件来获取选定的数据记录

controller:

onRecordSelection:function(oEvent) {

var data = oEvent.getParameter(" listItem")。getBindingContext(<模型名称(如果在将模型附加到表时提到)>。getProperty();

//数据包含所有 将选定行的行字段附加到对象头之后

var model = new sap.ui.model.json.JSONModel();//创建json模型

model.setData({selectedSet:data});//将选定的行数据附加到模型

this.getView()。byId(" <对象标头的id>")。setModel(model) ;//将模型附加到控件上(在您的情况下为对象标头)

this.getView()。byId(" <对象标头的id>")。bindElement("/img/selectedSet");//将对象绑定到控件

},

注意:在上述情况下,附在表项上的fieldsNames和对象标头propertyNames必须相同

我希望这会有所帮助, 我不知道您之后是否还会遇到任何问题。

谢谢

Viplove

哎,真难
2楼-- · 2020-08-18 02:51

非常感谢!!! 它可以正常工作:)

一周热门 更多>