cancel
Showing results for 
Search instead for 
Did you mean: 

RAP: Disable checkbox by other checkbox

lars_kr
Participant
0 Kudos
288

Hello Community,

In my RAP scenario, I have implemented two checkboxes when creating the entity. Now the customer should not be given the option to check both checkboxes at the same time. This means that if one of them is checked, the other must be disabled.

Something similar already exists with "feature controls" for actions, for example. But is there such a possibility with side effects to enable deactivation directly in the UI live?

I have a managed szenario with draft.

regards

Lars

View Entire Topic
patrick_winkler
Product and Topic Expert
Product and Topic Expert

I implemented the following example in SAP BTP 2405. Managed with draft, OData V4
BDEF:

  field ( features : instance )
   f1, f2;
  side effects {
    field f1 affects $self;
    field f2 affects $self;
  }

 Behavior implementation:

  METHOD get_instance_features.
    READ ENTITY IN LOCAL MODE ZI_Cubco8
      ALL FIELDS WITH CORRESPONDING #( keys )
      RESULT DATA(resi).
    result = VALUE #( FOR row IN resi ( %tky = row-%tky
      %features-%field-f1 = COND #( WHEN row-f2 = abap_true THEN if_abap_behv=>fc-f-read_only ELSE if_abap_behv=>fc-f-unrestricted )
      %features-%field-f2 = COND #( WHEN row-f1 = abap_true THEN if_abap_behv=>fc-f-read_only ELSE if_abap_behv=>fc-f-unrestricted )
       ) ).
  ENDMETHOD.

Result:

switch_editability.gif