Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
sap.m.List - change model on itemPress

I have sap.m.List with sap.m.StandardListItem within oDialog. When user opens oDialog, model is being set with main category list. Item press sets second model with child items, but List control showing blank items, first model is still set as default. What I'm doing wrong?

My code (oList):

  var oList = new sap.m.List({
        mode: "SingleSelectMaster",
        templateShareable: false,
        includeItemInSelection: true,
        itemPress: function (oEvent) {
            var sPath = oList.getSelectedItem().getBindingContext().sPath.substr(1);
            var sListID = oList.getId();

            var model = oList.getModel().getData();
            console.log("model current (press): ", model);
          
            //check item type
            var sItemType = oList.getSelectedItem().mProperties.type;
       
            if (sItemType == "Active") {
                    //do somtehing
            }
            

            //new model - child items
            var sURL = '/XMII/Runner?Transaction=Project/trasnaction&param1=' + param1;
            var oModel3 = new sap.ui.model.xml.XMLModel();
            oModel3.loadData(sURL,"Model" + sPath, false);
               
         
           
           oList.setModel(oModel3, "Model" + sPath);
           oList.setBindingContext(new sap.ui.model.Context(oModel3,  "Model" + sPath + ">/serviceInvocationResponse/responses"));
           oList.bindItems({
                            path: "/",
                            templateShareable: false,
                            template: oTemplate
                        });
        

            
            var newData = oList.getModel("Model" + sPath).getProperty("/"); //showing correct data from new model
            console.log("newData: ", newData);

            if (sItemType == "Navigation") {
                    //do somtehing
            }
        }
    });

I'm using SAP UI5 ver. 1.44.46

Thanks in advance!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!