Skip to Content
avatar image
Former Member

how to trigger GET_ENTITY class from sap ui5?

hi  all

we write some code in odata service... and

GET_ENTITY class execute successfully...

which returns only singal value.

but when try to trigger service from sap ui5 ---> its goes directly to GET_ENTITYSET.

how to execute GET_ENTITY?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Aug 21, 2015 at 04:39 PM

    Hi Radhesh.

    You need to put in parameters to your odata call to hit GET_ENTITY, something like below:

    oModel.createBindingContext("/Path(par1='" + filter1 + "',par2='" + Filter2)

    Hope this helps.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2015 at 02:39 AM

    Hi Radhes

    Pls see the sample code bellow rewards point its helpfull.

    oModelJson = new sap.ui.model.json.JSONModel();"/EntitySetname('"+oId+"')",null,null,true,function(oDataDialogNew,oResponse){


    Add comment
    10|10000 characters needed characters exceeded

    • Hi Radhesh,

      according to your routing configuration your are passed the parameter "Entity" for your details view.

      In your detail view controller's onRouteMatched method you take this parameter and set the view's binding context accordingly. Either you pass a simple value and build the URL for the OData GetEntity yourself [e.g. YourEntitySet(KeyField1='keyvalue1',KeyField2='keyvalue2') ] or your pass the binding path with this parameter.

      Please refer to this documentation (the "Controller" section) to have a best practive approach.

      Step 9: Detail View - UI Development Toolkit for HTML5 (SAPUI5) - SAP Library

      If you set a binding context using the YourEntitySet( [specify all key fields with values here] ) notation the the GetEntity Method will be called in NW Gateway.