Skip to Content
Author's profile photo Jerry Wang

How to detect EditMode in an Embedded Component

I am working together with a partner and they would like to implement a requirement in their embedded component.
  1. The embedded component is injected to a tab in a standard Thing inspector.
  2. Inside the EC there is a button. It is required that the button is only visible when Edit button in TI is clicked.
It means there must be an approach for EC which allows it to know currently it is in edit mode or not.
I find a solution for this requirement, however in my solution I use a standard field which is NOT exposed to Partner development. Since I am not responsible for the development of Cloud Studio in SAP I CANNOT guarantee this solution can still work in the future release. USE THIS SOLUTION AT YOUR OWN RISK!
1. Add the parameter debugMode=true in UI url,
And then ctrl+click on your C4C UI, then you are allowed to review some system field in tab “DataModel”. There is a field /Root/$System/EditMode which represents current Edit mode. When TI is in edit mode, it is equal to X:
“” for display mode.
2. Open your UI and manually create a field “EditMode” under $System node:
And bind the visibility attribute to this model field.
Test result in the runtime:

Assigned tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Baoxiang Lv
      Baoxiang Lv

      Hi Jerry,

      It's very useful,I have achieved my demand with your blog.

      Thanks

      Author's profile photo Former Member
      Former Member

      6666666666666666666666666666666

       

      Author's profile photo Dhruvin Mehta
      Dhruvin Mehta

      Lol This was fairly straight forward!! I hope SAP doesnt remove this! 😀

      Author's profile photo Denis Kitrish
      Denis Kitrish

      Hi, Jerry Wang !

      Thank you for this helpful blog.

      I have similar situation but cannot solve it.

      May be you know how to properly disable button if data is changed in inline edit mode in AdvancedListPane (/Root/$System/IsInlineEditDirty)? In this situation property /Root/$System/Saved equals true and I cannot hope on /Root/$System/IsInlineEditDirty because after Cancel of inline edit /Root/$System/IsInlineEditDirty is still X.