on 2024 Oct 24 5:43 AM
Dear community!
Is there a way to show/hide the Fiori elements on the object page with a custom "toggle" button using only virtual elements? By that I mean without having to create a persistent flag field in the CDS view?
USE CASE:
We have 2 lists in the object page and want to use a custom button to control whether one or the other list is displayed.
In other words: Is it possible to access and change the virtual elements in the implementation of the custom action? We only want this functionality to be instance-dependent at runtime and therefore persisting a "flag" is not an option for us.
Or is there another "best practice" solution for this?
Thank you very much!
Request clarification before answering.
Hi,
What exactly you mean by hiding the "list" in object page - do you mean you want to hide the table there? If so, you could do so by hiding the ReferenceFacet pointing to the table - see the usage of UI.Hidden annotation within the section "Sections on Object Page" in page.
The custom "toggle" button itself can be visible only for specific instances - again using the UI.Hidden=<path> to affect the visibility of the button. Once the button is clicked, you could define a "side-effect" to bring in the property to which the table (or ReferenceFacet's) visibility is bound to. See page for more information on side-effects.
Best Regards,
Sandeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Peter1972
How about you extend your object page with button by the Guided Development, i know its not best practice but its definitely doable. You can get the id of the section (it ends with ::Section) and set the visibility by custom action.
However the button is not „toggle“ its standard button but maybe you can manipulate it by text binding and css.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 14 | |
| 8 | |
| 6 | |
| 6 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.