cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to dynamically hide a facet

Nidhi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

I want to hide/show a facet based on the value selected in a value-help.

The approach that I have followed is as below:

I have created a virtual element of type 'boolean' in CAP CDS. I want to set the value of this virtual element on the basis of the value selected in the value help.

After the virtual element is initialized, I want to use this annotation in the UI '![@UI.Hidden]:virtual_element' to hide/unhide the facet.

I have tried printing the virtual element on the UI. It is showing as 'Yes' for true and '-' for false.

untitled.png

Regards,

Nidhi

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member14709
Contributor
0 Kudos

Hello Nidhi,

The issue seems to be with the data type you are using. Could you try with data type something similar to CHAR1 in ABAP? The same functionality works perfectly fine in RAP using same approach, as suggested in this blog

blogs.sap.com/2022/01/27/hiding-a-tab-dynamically-in-fiori-object-page-using-virtual-elements-in-rap-restful-abap-programming-model/comment-page-1/#comment-629814

Thanks,

Aman Garg