cancel
Showing results for 
Search instead for 
Did you mean: 

Call an Action in a Freestyle UI5 Application

koebelt
Explorer
0 Kudos
124

Hello, 
I'm quite confused. I'm trying to call an Action in my Bound UI5 View. It should be straightforward, but when trying the commonly accepted approach: 

 

async onPress() {
            var oModel = this.getView().getModel();
            var oActionODataContextBinding = oModel.bindContext("/someAction()");
            oActionODataContextBinding.execute().then(
                function() {
                    var oActionContext = oActionODataContextBinding.getBoundContext();
                    console.table(oActionContext.getObject().value);
                }.bind(this)
            );

        }

I get the following error: 

EventProvider.fireEvent: Event Listener for event 'press' failed during execution. - Error: The binding must be deferred

I'm still a bit new to making UI5 Freestyle Application. So I someone could guide me through what is going on.

Thanks.

 

View Entire Topic
Dinu
Active Contributor

Try `/someAction(...)` as described in OData Operations