Skip to Content

How to navigate from one entityset to another in SAP Web IDE ?

This is the SO report and when i click on any particular SO id, it should navigate to corresponding SO items. where should we implement the code for this in web ide.

Thanks.




so.png (21.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Dec 19, 2017 at 07:02 AM

    Hi Amrit,

    First Define targets and routes in manifest.json for View1 and View2.To do this go to manifest descriptor editor and add targets and routes for both the views.

    For View1 , create a pattern that will carry your so to view2.

    save changes in manifest descriptor editor and code will automatically be generated in code editor.

    Get the so number from View 1.

    onSelect of the listItem(list I presume?), get the soNumber

    in View1, write the below code

    onSelect:function(event){
    var soNumber=event.getSource().getSelectedKey();
    this.getRouter().navTo("View2",{
    soNum:soNumber
    },true);
    }

    in View2 routeMatched event, bind the view with the corresponding SONum

    var soNum= oEvent.getParameter("arguments").soNum;
    this.getModel().metadataLoaded().then( function() {
     var sObjectPath = this.getModel().createKey("SomeEntitySet", {
    SoNum:soNum
       }); 
    });  
    this._bindView("/" + sObjectPath);
    }.bind(this));

    Note: Here SoNum points to the property in oData(case-sensitive)

    _bindView : function (sObjectPath) {
    this.getView().bindElement({ path : sObjectPath});
    }
    Add comment
    10|10000 characters needed characters exceeded

  • Dec 14, 2017 at 07:12 AM

    Hi,

    Want to navigate from one View another view right? Is that what you want?

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 19, 2017 at 09:13 AM

    Please make sure, association and navigation is handled in odata service. Below entityset needs to be implemented.

    GET_EXPANDED_ENTITYSET

    Regards,
    Tejas

    Add comment
    10|10000 characters needed characters exceeded