0
votes

I'm trying to use Smart field in my new XML view without Smart filter bar in SAPUI5. I want to display this after press F4 like it is in Smart filter bar: Printscreen

I've already initialized OData service in my controller.js:

  onInit: function() {
         var oModel, oView;
              oModel = new sap.ui.model.odata.ODataModel("<serverURL>/sap/opu/odata/sap/ZACTIONS_SRV/", true);
              oModel.setCountSupported(false);
              oView = this.getView();
              oView.setModel(oModel);
  },

And this is my XML view:

<form:content>
        <smartField:SmartLabel labelFor="Applctn"/>
        <smartField:SmartField value="{Applctn}" id="Applctn"/>
</form:content>

But I get this error in Chrome and no Smart field is displayed. Error

1
Have you enabled CORS on your API? also expand your stacktrace will be helpful :)Ryan Chu

1 Answers

-1
votes

Try this piece of code

        $('yourControl').bind('keydown', function(e) {
            if (e.keyCode == 115) {

               // your statement to open goes here

            }
        });