如何在SAP C4C AdvancedListPane上批量执行若干BO实例的action-阿里云开发者社区

开发者社区> c位出道> 正文

如何在SAP C4C AdvancedListPane上批量执行若干BO实例的action

简介: 如何在SAP C4C AdvancedListPane上批量执行若干BO实例的action
+关注继续查看

My series of Cloud Application Studio Blogs

How to detect EditMode in an Embedded Component

Step by step to enable your custom BO with attachment upload functionality

Step by step to create an Adobe Print form in Cloud application Studio

How to render PDF which displays picture from the image attachment of your custom BO

How to get current logged on business user’s employee information and assigned organization unit via ABSL

How to implement dynamic access control based on custom BO using OWL

How to make Code List Restriction work when control field and restricted field are not on the same BO

How to implement custom number range using custom business object

Two approaches to create Code List in Cloud Studio

Create Dynamic Code List via Custom Business Object Association

Step by step to develop Thing Type based navigation and BO Object based navigation

Put Extension field into embedded component and make it visible in Standard UI

One possible cause that embedded component fails to display in UI

Step by step to create HTML Mashup and make it visible in UI

Step by step to enable Text Collection for your custom BO

Automatically send an Email notification to line manager via Workflow in Account application

Step by step to create Object Value Selector in Cloud Application Studio

Two approaches to fill an UI field with dedicated logic implemented in Cloud Application Studio

How to execute BO action on multiple selected BO instances in AdvancedListPane

How to add custom validation logic on mobile phone field in Contact TI

Recently one partner asked me about this question. Suppose I have a custom BO with one Date field “CloseDate”, and one indicator field “IsOverDue”.


[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-cT0qtTZZ-1598527168411)(https://upload-images.jianshu.io/upload_images/2085791-5a9459410cb7f3f8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)]


There is an action “OverDueCheckMass” defined with the simple logic that if current date < Close Date, then I consider the order as Overdue and vice versa.

The source code of this action implementation:

image.png

This action is marked as Mass-enabled.

image.png

Requirement is: in the table implemented by AdvancedListPane in UI Designer, if several rows are selected by Ctrl+Click ( Or Shift + Click ), once the button “Overdue check” is pressed, the action must be performed on those selected rows.


Take the below screenshot as example, the first and fourth row are selected, it is expected that after OverDue check is executed, IsOverDue indicator for the first row is determined as Yes.


image.png

Here below is details step how this requirement could be fulfilled.


(1) Specify the List SelectOption property as “multiSelectWithLeadSelection”.


image.png

Create a Data List in DataModel tab:

image.png

(2) Create an event handler with type BOAction. For instance Binding attribute, bind it to the Data List created in previous step. Choose “multiple” as Action Type and bind this event handler to BO Action OverDueCheckMass.


image.png

By default when you create a new event handler, Action Type is always set as single by default. Don’t worry, once you bind this action to the Instance Binding which points to a Data List in your Data Model and the BO action implementation is Mass-Enabled, once you click bind button, this Action Type will change into multiple automatically.


image.png

After these two steps are done, select the first and fourth row and press the OverDue check button – it works as expected

image.png

How it works under the hood

Suppose you have first pressed Ctrl key and then select the first and fourth row, how UI5 framework reacts to this event?

Set a breakpoint on function OnClick of file TablePointerExtension.js, and there is one attribute ctrlKey in the native HTML event object which indicates whether the Ctrl key is pressed in current event.

image.png

With this indicator, UI5 framework could react accordingly:

image.png

Since I have selected the SelectOption of my list as multiSelect, so UI5 uses an array to store the selected rows’ indexes:

image.png

Now when you click Overdue Check button with the state that first and fourth rows are selected, the breakpoint set in method SendAsyncPostRequest in file Request.js will be triggered. Check what exactly the data will be sent to backend by inspecting variable mParameters:

image.png


版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
Java 技术篇-IntelliJ IDEA 导入数据库驱动jar包实例演示
Java 技术篇-IntelliJ IDEA 导入数据库驱动jar包实例演示
8 0
阿里云服务器怎么设置密码?怎么停机?怎么重启服务器?
如果在创建实例时没有设置密码,或者密码丢失,您可以在控制台上重新设置实例的登录密码。本文仅描述如何在 ECS 管理控制台上修改实例登录密码。
10076 0
一个相同查询在不同 RDS for MySQL 实例上性能差异的案例分析
一个相同查询在不同 RDS for MySQL 实例上性能差异的案例分析 1. 问题出现 2. 问题原因 3. 问题解决 4. 问题结论 相同查询在数据量相近的情况下在不同 RDS for MySQL 实例上有不同的性能表现,容易引发用户对 RDS for MySQL 实例的性能差异性的疑虑,本文分享下近期碰到的一个原因比较隐蔽但很常见的案例。
139 0
Intellij idea使用postgresql 反向生成实例, 'Basic' attribute type should not be 'Object'
mapped type不能Object? 本人使用 intellij idea 15 , postgresql 9.4,在开发java ee 。 在用 Hibernate时, 需要用数据库表反向生成实例,数据库中部分字段,是Int4,在反转的时候会爆出错误,下面是我的测试图,有木有大牛了解,可不可给给点解决方法,【生成后手动一个个修改回来除外】,各种google过……唉,求教....   下拉框中并没有String或Integer 的选项,只有Object和序列化两种。
1135 0
阿里云物联网平台之独享实例下的amqp客户端连接
服务端可以直接订阅产品下多种类型的消息:设备上报消息、设备状态变化通知、设备生命周期变更、网关发现子设备上报、设备拓扑关系变更等。配置服务端订阅后,物联网平台会将产品下所有设备的已订阅类型的消息转发至您的服务器。 本文重点介绍独享实例下amqp客户端的连接以Java Demo为例。
1214 0
阿里云服务器如何登录?阿里云服务器的三种登录方法
购买阿里云ECS云服务器后如何登录?场景不同,阿里云优惠总结大概有三种登录方式: 登录到ECS云服务器控制台 在ECS云服务器控制台用户可以更改密码、更换系.
13883 0
MySQL 多实例的安装
MySQL 多实例的安装Step 1 . 准备工作关闭防火墙; 安装 MySQL依赖于libaio 库;下载,解压,重命名 MySQL的执行文件;新建用户组和用户 等准备工作在此不再赘述。 可执行文件目录为 /data/mysql57 添加用户和组的指令 groupadd mysql useradd mysql -g mysql Step 2 . 添加环境变量在/etc/profile文件中,追加 PATH=${PATH}:/data/mysql57/bin/ 保存后,如需要立即生效,可执行 source /etc/profile 。
1348 0
我的Android进阶之旅------&gt;Android之动画之Frame Animation实例
============================首先看看官网上关于Frame animation的介绍================================ 地址:http://developer.
918 0
+关注
2316
文章
0
问答
来源圈子
更多
+ 订阅
文章排行榜
最热
最新
相关电子书
更多
《2021云上架构与运维峰会演讲合集》
立即下载
《零基础CSS入门教程》
立即下载
《零基础HTML入门教程》
立即下载