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

How to show a facet after checkbox is selected

MattDion
Participant
0 Kudos
1,242

Using ABAP RAP, I have a Fiori Elements application that has a checkbox bound to a boolean value in my root entity. When the checkbox is selected, I need an additional facet to become visible that shows additional details that can be maintained.

I know in the UI annotations I can bind the facet visibility to a projected field, like so:

hidden: #( CheckboxIsNotSelected )

However, the value that I need is always has the opposite value of the checkbox. The value needs to be true when the checkbox is false, and vice versa.

I know I can:

  1. Create a virtual field in my projection view
  2. Implement a class to populate the virtual field based on my checkbox value
  3. Bind the UI facet hidden annotation to the virtual field
  4. Add side effects to the Fiori app (soon to be behavior definition) to update the virtual field anytime the checkbox value changes

But this seems like such a crazy workaround for what I assume to be a pretty basic and common requirement. Is there an easier way to bind the hidden annotation to the 'not' of a field?

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Exact same problem here, but because of the Backend Version I don't have side effects yet