Sent: Monday, December 22, 2014 4:14 PM

这里简单把现有的UI逻辑总结一下:

Notes Tab UI:

           <IconTabFilter id="tab_notes" icon="sap-icon://notes"key="Notes" text="{i18n>NOTES}" iconColor="Neutral"><FeedInput id="notesList" textMaxLength="1000" text="{json>Content}"post="_handleAddNote" showIcon="true" icon="{json>icon}" maxLines="3"></FeedInput><List id="listItem" showSeparators="Inner" growing="true"     growingThreshold="4" growingScrollToLoad="false"items="{json>/OpportunityNotesSet}"><FeedListItem sender="{path : 'json>Creator'}"     senderActive="false"timestamp="{path:'json>CreatedAt' , formatter: 'cus.crm.opportunity.util.Formatter.notesDateFormatter'}"text="{path : 'json>Content'}" /></List></IconTabFilter>

标签表示Tab Bar上的一个Tab, 表示新输入Note的控件, 表示每一条需要显示的Note。

显示的每一条Note是绑定在listItem model的OpportunityNoteSet属性上,每次点击Note Tab的时候,会执行S3.controller.js中的notesTabSelected()方法:

notesTabSelected : function(){var oModel = this.getView().getModel();             this.byId("listItem").setNoDataText(sap.ca.scfld.md.app.Application.getImpl().getResourceBundle().getText('LOADING_TEXT'));this.byId('listItem').getModel('json').oData.OpportunityNotesSet = [];this.byId('listItem').getModel('json').updateBindings();       oModel.read(this.sPath, null, [ "$expand=Notes" ], true,
// 在这里发起OData的调用,http://localhost:8080/sap/opu/odata/sap/CRM_OPPORTUNITY/Opportunities(guid'0090FA0D-8D72-1ED3-98C7-DC2E25228BC4')?$expand=NotesjQuery.proxy(function(odata, response) {var tab = this.getView().byId("listItem");var oJSONModel = tab.getModel("json");var oData = oJSONModel.oData;// 返回的结果绑定到listItem model的OpportunityNotesSet上oData.OpportunityNotesSet = response.data.Notes.results;if(oData.OpportunityNotesSet.length == 0){                                                                                                                this.byId("listItem").setNoDataText(sap.ca.scfld.md.app.Application.getImpl().getResourceBundle().getText('NONOTES'));}// 用新返回的数据刷新UIoJSONModel.updateBindings();                          },this),jQuery.proxy(function(oError){this.handleErrors(oError);},this)
);},

每次添加一条Note的时候会调用FeedInput控件上绑定的post事件对应的_handleAddNote()方法:

                     <FeedInput id="notesList" textMaxLength="1000" text="{json>Content}"post="_handleAddNote" showIcon="true" icon="{json>icon}" maxLines="3"></FeedInput>
          _handleAddNote : function(oEvent) {// 获取输入的内容var sText = oEvent.getParameter("value");if (sText) {var that = this;var oModel = this.getView().getModel();                                   var headerGuid = this.byId('info').getModel('json').getData().Guid;var oEntry = {HeaderGuid : headerGuid,Content : sText};// 创建一条新的Note http://localhost:8080/sap/opu/odata/sap/CRM_OPPORTUNITY/OpportunityNotesSet                                oModel.create('/OpportunityNotesSet',oEntry,null,jQuery.proxy(function() {var that = this;// 创建新的Note成功之后的回调方法里面重新获取新的Note List, 然后绑定到model的OpportunityNotesSet上oModel.read( that.sPath, null, [ "$expand=Notes" ],true,
function(odata,response){that.byId('listItem').setModel(new sap.ui.model.json.JSONModel({OpportunityNotesSet: odata.Notes.results}),"json");});                                                            }, this),function(oMessage) {that.displayResponseErrorMessage(oMessage,sap.ca.scfld.md.app.Application.getImpl().getResourceBundle().getText('SAVE_FAILED'));}
);}},

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

SAP CRM Fiori应用My Note的OData调用设计相关推荐

  1. SAP CRM Fiori应用My note的技术实现

    (1) 在左边的list里看到的每个entry,在My note odata model里称为note header,右边的每个checkbox后面的entry称为note section. Note ...

  2. 在 SAP CRM Fiori 应用上给 Opportunity 订单添加 note 的后台执行明细

    在 SAP CRM Fiori 应用上给 Opportunity 订单添加 note 的后台执行明细: 修改某些字段之后点击保存按钮: I change "chance of success ...

  3. SAP CRM Fiori Launchpad 登录之后,看不见任何 tile 的解决办法

    我登录 SAP CRM Fiori gateway 系统,发现 Launchpad 里一个 tile 也没有: 解决方法 事物码 PFCG,从标准的 role SAP_CRM_BCR_SALESREP ...

  4. SAP CRM Fiori 应用和 SAP Commerce Cloud (电商云) UI 如何通过调整 CSS 来改变UI显示风格

    这是Jerry 2021年的第 19 篇文章,也是汪子熙公众号总共第 290 篇原创文章. 本文分别针对 SAP CRM Fiori 应用和 SAP Commerce Cloud (电商云) UI,介 ...

  5. SAP CRM Fiori应用My Opportunity标题显示不正确的问题分析

    这个问题最后的分析结果令人啼笑皆非. 问题的症状:CRM Fiori应用My Oppportunity, 点击任何一个Opportunity进入明细页面,应该看到的标题是Opportunity det ...

  6. SAP CRM Fiori note automatic delete deletion scenario

    if current user does not own any note, a new dummy one with title "Untitled" will be creat ...

  7. SAP CRM Fiori note header

    Created by Wang, Jerry, last modified on May 12, 2015

  8. SAP CRM Fiori应用里的note section

    Created by Wang, Jerry, last modified on May 12, 2015 要获取更多Jerry的原创文章,请关注公众号"汪子熙":

  9. SAP CRM Fiori My note应用的note header设计

    Created by Wang, Jerry, last modified on May 12, 2015 要获取更多Jerry的原创文章,请关注公众号"汪子熙":

最新文章

  1. DATEIF实例说明6
  2. OnFocuChangeListener焦点事件
  3. OpenJudge/Poj 2027 No Brainer
  4. mysql数学函数名_Mysql数学函数
  5. ARM中的ldr指令与adr、ldr伪指令之间的区别
  6. C语言指针操作字符数组demo
  7. typeorm mysql2_指南 - 使用 TypeORM 和 Express 的示例 - 《TypeORM v0.2.20 中文文档》 - 书栈网 · BookStack...
  8. oracle 实例多一些的书,Oracle+Database+11g+PLSQL编程实战(书+源码)
  9. JavaScript -- DOM树
  10. visual stadio.net已检测到web服务器运行的不是asp.net1.1版故障的排除
  11. Mac 连不上华为 p9 处理历程(二)
  12. 一位腾讯离职创业 6 年 CEO 的忠告:不要等公司倒闭,才思考这 3 个问题
  13. 2022美国大学生数学建模竞赛C题思路
  14. 软件模式、GRASP原则,GoF设计模式、设计模式分类、设计模式的优点。
  15. 二维数组(动态规划)
  16. kali linux 网络渗透测试学习笔记(三)社会工程学之Java攻击:钓鱼网站制作
  17. 如何搭建免费图床给Typora使用(PicGo + Gitee(码云)实现markdown图床)
  18. 【linux基础1】linux命令行使用技巧
  19. 使用dom4j来解析xml文件或xml字符串
  20. 杭州河坊街特色手机饰品——招财猫!

热门文章

  1. 应用程序环境块相关代码
  2. 《Advanced .NET Debugging》 读书笔记 Listing 3-2: 如何查看程序的PID
  3. python学习高级篇(part6)--内置函数dir
  4. 第三次学JAVA再学不好就吃翔(part53)--StringBuffer类的构造方法
  5. mac版python安装pandas_Mac OS 安装pandas
  6. SAP 电商云 Spartacus UI 的 style library 介绍
  7. Angular tsconfig.json 文件里的 paths 用法和 scoped module 定义
  8. SAP Spartacus Theme 设置
  9. TypeScript 里 tsconfig.json 文件的作用
  10. SAP Spartacus 的页面模型在SAP 电商云后台WCMS里的模型