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

Enable/Disable custom action button in SAP Fiori List Report

tejaswikosanam
Explorer
2,992

I have created a Fiori elements list report app. In this app, I have a table with single select radio button and also a custom action button at the toolbar. Now, this custom button will be enabled only when I select any of the row using radio button. (In Manifest.json I have used requireSelection: true). Till now everything works as expected. Now, I want to enable this custom button when user selected any row using radio button + particular column in that row contains a value 'X' (condition based).
How do I achieve that. Please share your suggestions. 

Thanks, 

Teja.

 

Accepted Solutions (1)

Accepted Solutions (1)

tejaswikosanam
Explorer

Hi, I tried using 'applicablePath' in button's property with in manifest.json. The value to this 'applicablePath' is entity type property from entityset with boolean type.

Answers (2)

Answers (2)

MioYasutake
SAP Champion
SAP Champion

@tejaswikosanam 

In manifest.json, you can specify a function to determine if the action should be enabled or disabled.

https://sapui5.hana.ondemand.com/#/topic/7619517a92414e27b71f02094bd08d06

"myCustomEnablement": {
     "press": "SalesOrder.ext.CustomActions.navigateExternal",
     "enabled": "SalesOrder.ext.CustomActions.enabledForCompletedOnly",
     "text": "Enabled for Completed"
}
enabledForCompletedOnly: function(oBindingContext, aSelectedContexts) {
     if (aSelectedContexts && aSelectedContexts.length === 1) {
          return true;
     }
    
    return false;
}

 

 

Marian_Zeis
Active Contributor
Did not know this before. Thank you for that information!
tejaswikosanam
Explorer
0 Kudos
Hi,
tejaswikosanam
Explorer
0 Kudos
I will try this option as well.
AbhishekSharma
Active Contributor

Hi @tejaswikosanam 

You probabily need Feature control (Instant Feature), please have a look to below blog post contains what you needed...

action (feature : instance) <your action name> result [1] $self;

Also Implement the Get_instance_feature method to set button enable or disabled.

https://community.sap.com/t5/technology-blogs-by-members/how-to-add-feature-control-in-abap-restful-... 

Hope this helps...

 

Thanks-

 

tejaswikosanam
Explorer
0 Kudos

Hi, I tried using 'applicablePath' in button's property with in manifest.json. The value to this 'applicablePath' is entity type property from entityset with boolean type.