cancel
Showing results for 
Search instead for 
Did you mean: 

Enable/Disable custom action button in SAP Fiori List Report

tejaswikosanam
Explorer
0 Kudos
379

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.

 

View Entire Topic
MioYasutake
Active Contributor

@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.