cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Hide/show Fiori elements using a custom action button

Peter1972
Discoverer
0 Kudos
1,145

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!

Accepted Solutions (0)

Answers (2)

Answers (2)

sandeep_rs
Product and Topic Expert
Product and Topic Expert
0 Kudos

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

Peter1972
Discoverer
0 Kudos
Hello Sandeep! Exactly! We would like to make the entire table invisible on the object page, or alternately show/hide 2 tables using a button. We already have the technique with “hide” in the facet, the second part with side effects is a new point that we could try out. Thanks first, we'll look into it and try it out. We'll let you know later whether and how it worked!
Altarkawi67
Participant
0 Kudos

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.