0
votes

Here i have problem to navigate between icontabfilter on the same page using OData service. Well i have a icontabfilter with all data from the odata service and on the same list i have navigation icon.

What i need is when i make onPress event i need to route and navigate from one icon tab to another on the same page. Addition OData service is connected to from "ProductHeadSet/ProductBOM". So When i click on the number f.e : 12345 ID from ProductHeadSet it should route me to BOM IconTab which it is linked with ProductHeadSet and should display information related to 12345.

Controller.js

var oListItem= this.getView().byId("BoMSet"); 
oListItem.bindItems({ 
    path : "invoice>/ProductHeadSet('12345')/ProductHead2BOM", 
    template : new sap.m.StandardListItem({ 
        title: "{invoice>BomNumber}", 
        description: "{invoice>Material}" 
    })
});

View.xml

<List
id="BoMSet"
headerText="BoM"
items="{
    path: '/Products'
}">
    <items>
      <ObjectListItem
         intro="{invoice>Material}"
         title="{invoice>BomNumber}">
       </ObjectListItem>
    </items>

manifest.json

"invoice": {
        "dataSource": "invoiceRemote"

After this i kinda blank, as i am not sure how can i proceed after this to achieve the needs.

Edited: Code which is causing the problem. And i have tried in two ways both are not working.

 onItemSelected: function(oEvent) { 
             var oSelectedItem = oEvent.getSource(); 
             var oContext = oSelectedItem.getBindingContext("ProductHead2BOM"); 
             var sPath = oContext.getPath(); 
             var oinvoiceList = this.byId("BoMSet"); 
             oinvoiceList.bindElement({ path: sPath, model: "ProductHead2BOM" }); 
             }

2.

    onPress : function(oEvent){
        var oSelectedItem = oEvent.getsource();
        var oContext = oSelectedItem.getBindingContext("ProductHeadSet");
        var oBoMSet = this.getView().byId("BoMSet");
        oBoMSet.bindElement("invoice>/ProductHeadSet('5199182')/ProductHead2BOM");

Path:invoice>/ProductHeadSet('12345')/ProductHead2BOM I need to have Table view on new iconTab. When i click on single product from productHeadset from first IconTab it should navigate me to new icon tab with linked information of ('12345') to get info of ProductHead2BOM

Thanks and aprreciated !!!

1

1 Answers

0
votes

I think before having to explain the routing and navigation I want to ask you to check if you even need routing here. The answer is No, you don't require routing.

Routing is required only when you try to show a different view than the one opened.

In your case, as you mentioned, there is iconTab on the same view which means the oData model can be bound to the view and can be accessed throughout.

I would suggest you check something called element binding which can solve your problem of binding a context to one iconTab or a Table.

Hope this helps you!