Hello experts,
I would like to know why can't I see the rows created as virtual entry in a table (sap.m.table) using odata model, there is no error in browser debugger.
Code snippet:
//Obtiene los paths de la lista de criterios var pathList = oModel.getProperty(contextTable.sPath+"/ToApprCategory"); //var binding = list.getBinding("items"); oEntry = {}; batchChanges = []; for (var pos in context){ oModelListQual = context[pos].getModel(); oItem = oModelListQual.getProperty(context[pos].sPath); oEntry.RowIiD = "0010"; oEntry.ForeignId = oItem.ElementId; oEntry.ForeignType = oItem.ElementType; oEntry.ItemText = oItem.ItemText; oEntry.WeightingEnabled = "X"; oEntry.PartialGradeEnabled = "X"; oEntry.FinalGradeEnabled = "X"; oEntry.Weighting = "0.067"; oEntry.PartialGrade = "463.000"; oEntry.FinalGrade = "463.000"; oEntry.TxtPartialGrade = "Muy bueno"; oEntry.TxtFinalGrade = "Muy bueno"; oEntry.ParentIid = "0003"; itemContext = oModelListQual.createEntry("ApprCategorySet",oEntry); pathList.push(itemContext.sPath.substring(1)); }
This code is called at confirm event of the select dialog popup, where i pick some records and click on ok button and this data had to be inserted in table (sap.m.table). context variable is an array of contexts of the data i pick from the select dialog. variable contextTable.sPath contains value "/ApprCatgGroupSet('0003')".
I clarify that i am using $expand to retrieve the data, part of the url of the service call is the following:
/ApprCatgGroupSet/?$expand=ToApprCategory&$format=json. the following is the odata service in response to this call.
This table is linked to entity ApprCategory from a relationship between 2 entities, ApprCatGroupSet is the principal entity and ApprCategory is the dependant entity.
I am a little confused here, because i try to use ToApprCategory instead of ApprCategorySet and this issues an error, that's why i had to use ApprCategorySet.
In this line I create the entry and get the context of the entry:
itemContext = oModelListQual.createEntry("ApprCategorySet",oEntry);
In this line i link the data to the expand object ToApprCategory:
pathList.push(itemContext.sPath.substring(1));
I appreciate your help.
Jhon Jairo Teran.