Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

147
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda