SAP Cloud for Customer Oberon视图里的Ruby Scrip
In C4C Oberon views developed by UI Designer it is allowed to write Ruby script at some given position. Once you activate the Oberon view in UI Designer, corresponding JavaScript code will automatically be created and visible in XRepository. Here below are some typical positions where Ruby Script could be inserted:
Where could Ruby Script be inserted in UI Designer
(1) In Event operation with type “Script”
Ruby Script:
if ($data.UIState.ViewSwitchSelectedItem == "Collections")
$controller.HandleEvent("OnRefreshCollection");
end
The corresponding JavaScript code is then visible in view’s source code in XRepository:
(2) In Operation configure tab:
The automatically generated JavaScript code:
(3) Dynamical manipulation on the value of control attribute via Script Take “Visible” for example:
Then you can write script here:
How to debug Script in the runtime
Set a breakpoint in function _executeScript in file resources/sap/client/evt/ClientOperation.js. In the runtime, a new JavaScript function will be dynamically created based on the source code stored in XRepository in line 292, and immediately gets called in subsequent line 293.
Still take the Script above as example, if you just would like to know the actual value of $System.ClientType in the runtime, it is not necessary to figure it out via debugging. Instead, append the url fragment “debugMode=true”, and then launch application again.
Press control key and click page, the client Inspector will be opened. Switch to tab “Data Model”, search by keyword “ClientType”, and then you can get its runtime value “NEW_HTML”.
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- 基于NPOI的Excel导入导出类库
- 在tinycolinux32上装tinycolinux64 kernel和toolchain
- 通过链下签名授权实现更少 Gas 的 ERC20代币
- 在dbcolinux上安装cozy-light
- 在群晖docker上装elmlang可视调试编码器ellie
- Elasticsearch:inverted index,doc_values及source
- 在群晖docker上构建私有云IDE和devops构建链
- 小白学PyTorch | 14 tensorboardX可视化教程
- Apache Solr 漏洞复现
- Elasticsearch rollover API
- 重发和重定向有什么区别与重定向应用
- 为tinycolinux制作应用包
- CrossC2的2.0版本
- 使用OpenCV和Python计算图像的“色彩”
- 为tinycolinux创建应用包-toolchain和编译方法