SAP C4C裡如何建立兩個具有依賴關係的下拉選單
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
- An example about how I analyze why some OBN button does not work
- Step by step to create OBN button which navigates from standard UI to custom UI
- Service Request ticket split – how to bring the selected service request item to new custom UI
- Step by step to create two drop down list with dependency
- Expose Custom BO logic implemented by ABSL via Custom OData service
I am asked by colleague about how to develop two drop down list with dependency via Cloud application studio. Typical use case could be for example the first one gives user a list of countries in the world, and once a certain country code is selected, only the very states belonging to that country is listed in the second drop down list.
Here below is a kind of approach how to achieve it.
Suppose the first list is a set of programming language,
when I select ABAP, only ABAP tools are listed in the second list.
The same for Java List:
Before you start the development, make sure you have gone through the blog Create Dynamic Code List via Custom Business Object Association as this blog is written based on some enhancement on it.
(1) The complete source code of JerryCodeList BO:
Create the following instance for this BO: Language list:
Java tool list:
ABAP tool list:
(2) In the MainBO on which the two dependent code lists are built, inserted the following highlighted source code:
Implement the association ToLanguageList in AfterModify determination:
if( !this.ToLanguageList.IsSet() ){
var codeListQuery = JerryCodeList.QueryByElements;
var para = codeListQuery.CreateSelectionParams();
para.Add( codeListQuery.CodeListBOID, "I", "EQ", "LANGUAGE");
var result = codeListQuery.Execute(para);
this.ToLanguageList = result.GetFirst();}
For the other association ToLanguageToolList, we should NOT implement it in AfterModify since it is dependent on the selection of first drop down list.
(3) Bind two drop down list accordingly:
The essential part here is: as long as there is selection change on the first drop down list, the notification must be sent to second drop down list to perform restriction on its entries. Here a new event handler is introduced for notification.
Create a new query bound to CodeList.QueryByElements with a query parameter which points to Code List entry’s parent code:
then in the event handler, in the first operation I assign the selected language code chosen from first drop down list to the query parameter, then fire the query in the second operation, as a result the possible entries for the second drop down list are restricted by language code accordingly.
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2724416/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 如何在SAP Cloud for Customer裡開發具有依賴關係的互動下拉選單Cloud
- 如何在 SAP BTP 上建立 Module 之間具有依賴關係的 SAP MTA 應用
- Maven 依賴關係Maven
- build task依賴關係UI
- 透過構建具有依賴關係的後端框架來學習 Nodejs後端框架NodeJS
- 如何管理前端專案中的複雜依賴關係前端
- Spring框架模組依賴關係Spring框架
- 【python】【安裝包依賴關係】Python
- 【物件導向依賴關係概念總結】物件導向程式設計的五種依賴關係物件程式設計
- Maven中如何管理多模組專案的依賴關係Maven
- 使用簡單的Java程式碼在SAP C4C裡建立銷售訂單Java
- Elasticsearch依賴與Spring對應關係ElasticsearchSpring
- 如何給SAP C4C的產品主資料division配置出新的下拉選項
- 專案管理中,如何識別和管理依賴關係?專案管理
- Java基礎:如何在IDEA中檢視依賴關係JavaIdea
- 幽默:如何建立一個良好的關係?
- spring cloud alibaba 元件版本關係 以及 畢業版本依賴關係SpringCloud元件
- SAP Spartacus OccEndpointsService單元測試的依賴注入依賴注入
- gcc 標頭檔案依賴關係 分析工具GC
- SAP物料主資料建立時間和建立個數的函式關係函式
- 物件導向程式設計程式碼詳解(依賴關係,關聯關係,組合關係)物件程式設計
- SpringBoot中的slf4j日誌依賴關係Spring Boot
- 如何建立依賴專案工程--android moduleAndroid
- SAP WebClient UI drop down list(下拉選單)的一個故障和解決方法WebclientUI
- 微服務下 Spring Boot Maven 工程依賴關係管理微服務Spring BootMaven
- 使用nodejs程式碼在SAP C4C裡建立Individual customerNodeJS
- 使用Gradle檢視Android專案中庫的依賴關係GradleAndroid
- 什麼是專案管理中的任務依賴關係專案管理
- SAP UI5 如何透過 manifest.json 檔案定義第三方庫依賴關係UIJSON
- antd design Menu選單下拉回撥以及下拉選單時只能顯示一個列表,其餘關閉
- 使用 Java 在Excel中建立下拉選單JavaExcel
- [開發教程] 第32講:Bootstrap導航選單裡的下拉選單boot
- 一, 建立工程,引入依賴
- Struts2所有依賴關係(struts-2.5.14.1)
- 【譯】Android Gradle 外掛 4.0.0 中 Feature-on-Feature 的依賴關係AndroidGradle
- 如何使用SAP C4C Repository Explorer裡的BO test shell
- SAP Commerce Cloud 裡的 User 模型和 Restriction 的關係Cloud模型REST
- 關於 Gradle 依賴庫的幾個東西Gradle