Data Binding to the Table error is not a fucntion












0














I have problem with binding the OData to the table. When i define a function in js file it says "is not a function"



odata.js



getBoM : function(iNumber){


var sNumber = iNumber.toString();
while (sNumber.length < 18) {
sNumber = "0" + sNumber
}


var vUriRead = "/ProductHeadSet('12345')/ProductHead2BOM";
var oResult;

this.initODataModel( );

this.oDataModel.read(vUriRead, null, null, false, function(oData, oResponse) {
oResult = oData;
}, function(oError) {
jQuery.sap.log.error("OData-Error in function getBoM (EntityBoMSet)");
xyz_homepage.xyz_homepage.src.odata.displayRequestFailedMessage(oError);
});

return oResult;
},


Controller.js



var oProductHead2BoM = xyz_homepage.xyz_homepage.src.odata.getBoM(iNumber);

this.oModelProductHead2BoM.setData(oProductHead2BoM);


at the .getBoM(iNumber) it says, "Uncaught TypeError: xyz_homepage.xyz_homepage.src.odata.getBoM is not a function"



Edit :
controller.js



handleRouteMatched : function(oEvent) {
if (oEvent.getParameter("name") === "page") {
var iNumber = oEvent.getParameter("arguments").number;

var oDataResult = xyz_homepage.xyz_homepage.src.odata
.getDetailsProd(iNumber);
this.oModelProdManag.setData(oDataResult);

var aDocuments = xyz_homepage.xyz_homepage.src.odata.getDocumentsProd(iNumber);

this.oModelDocuments.setData(aDocuments);

//Call bom routine and set data

var oProductHead2BoM = xyz_homepage.xyz_homepage.src.odata.getProductHead2BOM(iNumber);

this.oModelProductHead2BoM.setData(oProductHead2BoM);


So when i debug and click on function ".getDocumentsProd" i can find the function which is reference to odata.js



Odata.js



getDocumentsProd Function



getDocumentsProd : function(iNumber){

var sNumber = iNumber.toString();
while (sNumber.length < 18) {
sNumber = "0" + sNumber
}
var vUriRead = "/DocumentsSet/?$filter=Material%20eq%20'" + sNumber + "'";

var oResult;

this.initODataModel( );
this.oDataModel.read(vUriRead, null, null, false, function(oData, oResponse) {
oResult = oData.results;
}, function(oError) {
jQuery.sap.log.error("OData-Error in function getDocumentsProd (EntityDocumentsSet)");
xyz_homepage.xyz_homepage.src.odata.displayRequestFailedMessage(oError);
});

return oResult;

},


On the same note i have for the getProductHead2BOM function.



getProductHead2BOM : function(iNumber){

var sNumber = iNumber.toString();
while (sNumber.length < 18) {
sNumber = "0" + sNumber
}


var vUriRead = "/ProductHeadSet('5199182')/ProductHead2BOM";
var oResult;

this.initODataModel( );

this.oDataModel.read(vUriRead, null, null, false, function(oData, oResponse) {
oResult = oData;
}, function(oError) {
jQuery.sap.log.error("OData-Error in function getProductHead2BOM (EntityProductHead2BOM)");
zplm_homepage.zplm_homepage.src.odata.displayRequestFailedMessage(oError);
});

return oResult;
}


I could see documents Odata but not for ProductsHeadBom



enter image description here










share|improve this question
























  • Can you share the fine structure and more code of the affected files?
    – Nandan Chaturvedi
    Nov 21 '18 at 15:21










  • Problem is that i don't see the function on sources(chrome) though it exists in IDE.
    – Rocket
    Nov 21 '18 at 15:55










  • You must import it somewhere to be able to use it.
    – Nandan Chaturvedi
    Nov 22 '18 at 3:02










  • use the require part of the controler to import the js file in which you function is
    – Erch
    Nov 22 '18 at 6:36






  • 1




    why is the part titled with view.XML still js code? i am confused
    – Erch
    Nov 22 '18 at 6:37
















0














I have problem with binding the OData to the table. When i define a function in js file it says "is not a function"



odata.js



getBoM : function(iNumber){


var sNumber = iNumber.toString();
while (sNumber.length < 18) {
sNumber = "0" + sNumber
}


var vUriRead = "/ProductHeadSet('12345')/ProductHead2BOM";
var oResult;

this.initODataModel( );

this.oDataModel.read(vUriRead, null, null, false, function(oData, oResponse) {
oResult = oData;
}, function(oError) {
jQuery.sap.log.error("OData-Error in function getBoM (EntityBoMSet)");
xyz_homepage.xyz_homepage.src.odata.displayRequestFailedMessage(oError);
});

return oResult;
},


Controller.js



var oProductHead2BoM = xyz_homepage.xyz_homepage.src.odata.getBoM(iNumber);

this.oModelProductHead2BoM.setData(oProductHead2BoM);


at the .getBoM(iNumber) it says, "Uncaught TypeError: xyz_homepage.xyz_homepage.src.odata.getBoM is not a function"



Edit :
controller.js



handleRouteMatched : function(oEvent) {
if (oEvent.getParameter("name") === "page") {
var iNumber = oEvent.getParameter("arguments").number;

var oDataResult = xyz_homepage.xyz_homepage.src.odata
.getDetailsProd(iNumber);
this.oModelProdManag.setData(oDataResult);

var aDocuments = xyz_homepage.xyz_homepage.src.odata.getDocumentsProd(iNumber);

this.oModelDocuments.setData(aDocuments);

//Call bom routine and set data

var oProductHead2BoM = xyz_homepage.xyz_homepage.src.odata.getProductHead2BOM(iNumber);

this.oModelProductHead2BoM.setData(oProductHead2BoM);


So when i debug and click on function ".getDocumentsProd" i can find the function which is reference to odata.js



Odata.js



getDocumentsProd Function



getDocumentsProd : function(iNumber){

var sNumber = iNumber.toString();
while (sNumber.length < 18) {
sNumber = "0" + sNumber
}
var vUriRead = "/DocumentsSet/?$filter=Material%20eq%20'" + sNumber + "'";

var oResult;

this.initODataModel( );
this.oDataModel.read(vUriRead, null, null, false, function(oData, oResponse) {
oResult = oData.results;
}, function(oError) {
jQuery.sap.log.error("OData-Error in function getDocumentsProd (EntityDocumentsSet)");
xyz_homepage.xyz_homepage.src.odata.displayRequestFailedMessage(oError);
});

return oResult;

},


On the same note i have for the getProductHead2BOM function.



getProductHead2BOM : function(iNumber){

var sNumber = iNumber.toString();
while (sNumber.length < 18) {
sNumber = "0" + sNumber
}


var vUriRead = "/ProductHeadSet('5199182')/ProductHead2BOM";
var oResult;

this.initODataModel( );

this.oDataModel.read(vUriRead, null, null, false, function(oData, oResponse) {
oResult = oData;
}, function(oError) {
jQuery.sap.log.error("OData-Error in function getProductHead2BOM (EntityProductHead2BOM)");
zplm_homepage.zplm_homepage.src.odata.displayRequestFailedMessage(oError);
});

return oResult;
}


I could see documents Odata but not for ProductsHeadBom



enter image description here










share|improve this question
























  • Can you share the fine structure and more code of the affected files?
    – Nandan Chaturvedi
    Nov 21 '18 at 15:21










  • Problem is that i don't see the function on sources(chrome) though it exists in IDE.
    – Rocket
    Nov 21 '18 at 15:55










  • You must import it somewhere to be able to use it.
    – Nandan Chaturvedi
    Nov 22 '18 at 3:02










  • use the require part of the controler to import the js file in which you function is
    – Erch
    Nov 22 '18 at 6:36






  • 1




    why is the part titled with view.XML still js code? i am confused
    – Erch
    Nov 22 '18 at 6:37














0












0








0







I have problem with binding the OData to the table. When i define a function in js file it says "is not a function"



odata.js



getBoM : function(iNumber){


var sNumber = iNumber.toString();
while (sNumber.length < 18) {
sNumber = "0" + sNumber
}


var vUriRead = "/ProductHeadSet('12345')/ProductHead2BOM";
var oResult;

this.initODataModel( );

this.oDataModel.read(vUriRead, null, null, false, function(oData, oResponse) {
oResult = oData;
}, function(oError) {
jQuery.sap.log.error("OData-Error in function getBoM (EntityBoMSet)");
xyz_homepage.xyz_homepage.src.odata.displayRequestFailedMessage(oError);
});

return oResult;
},


Controller.js



var oProductHead2BoM = xyz_homepage.xyz_homepage.src.odata.getBoM(iNumber);

this.oModelProductHead2BoM.setData(oProductHead2BoM);


at the .getBoM(iNumber) it says, "Uncaught TypeError: xyz_homepage.xyz_homepage.src.odata.getBoM is not a function"



Edit :
controller.js



handleRouteMatched : function(oEvent) {
if (oEvent.getParameter("name") === "page") {
var iNumber = oEvent.getParameter("arguments").number;

var oDataResult = xyz_homepage.xyz_homepage.src.odata
.getDetailsProd(iNumber);
this.oModelProdManag.setData(oDataResult);

var aDocuments = xyz_homepage.xyz_homepage.src.odata.getDocumentsProd(iNumber);

this.oModelDocuments.setData(aDocuments);

//Call bom routine and set data

var oProductHead2BoM = xyz_homepage.xyz_homepage.src.odata.getProductHead2BOM(iNumber);

this.oModelProductHead2BoM.setData(oProductHead2BoM);


So when i debug and click on function ".getDocumentsProd" i can find the function which is reference to odata.js



Odata.js



getDocumentsProd Function



getDocumentsProd : function(iNumber){

var sNumber = iNumber.toString();
while (sNumber.length < 18) {
sNumber = "0" + sNumber
}
var vUriRead = "/DocumentsSet/?$filter=Material%20eq%20'" + sNumber + "'";

var oResult;

this.initODataModel( );
this.oDataModel.read(vUriRead, null, null, false, function(oData, oResponse) {
oResult = oData.results;
}, function(oError) {
jQuery.sap.log.error("OData-Error in function getDocumentsProd (EntityDocumentsSet)");
xyz_homepage.xyz_homepage.src.odata.displayRequestFailedMessage(oError);
});

return oResult;

},


On the same note i have for the getProductHead2BOM function.



getProductHead2BOM : function(iNumber){

var sNumber = iNumber.toString();
while (sNumber.length < 18) {
sNumber = "0" + sNumber
}


var vUriRead = "/ProductHeadSet('5199182')/ProductHead2BOM";
var oResult;

this.initODataModel( );

this.oDataModel.read(vUriRead, null, null, false, function(oData, oResponse) {
oResult = oData;
}, function(oError) {
jQuery.sap.log.error("OData-Error in function getProductHead2BOM (EntityProductHead2BOM)");
zplm_homepage.zplm_homepage.src.odata.displayRequestFailedMessage(oError);
});

return oResult;
}


I could see documents Odata but not for ProductsHeadBom



enter image description here










share|improve this question















I have problem with binding the OData to the table. When i define a function in js file it says "is not a function"



odata.js



getBoM : function(iNumber){


var sNumber = iNumber.toString();
while (sNumber.length < 18) {
sNumber = "0" + sNumber
}


var vUriRead = "/ProductHeadSet('12345')/ProductHead2BOM";
var oResult;

this.initODataModel( );

this.oDataModel.read(vUriRead, null, null, false, function(oData, oResponse) {
oResult = oData;
}, function(oError) {
jQuery.sap.log.error("OData-Error in function getBoM (EntityBoMSet)");
xyz_homepage.xyz_homepage.src.odata.displayRequestFailedMessage(oError);
});

return oResult;
},


Controller.js



var oProductHead2BoM = xyz_homepage.xyz_homepage.src.odata.getBoM(iNumber);

this.oModelProductHead2BoM.setData(oProductHead2BoM);


at the .getBoM(iNumber) it says, "Uncaught TypeError: xyz_homepage.xyz_homepage.src.odata.getBoM is not a function"



Edit :
controller.js



handleRouteMatched : function(oEvent) {
if (oEvent.getParameter("name") === "page") {
var iNumber = oEvent.getParameter("arguments").number;

var oDataResult = xyz_homepage.xyz_homepage.src.odata
.getDetailsProd(iNumber);
this.oModelProdManag.setData(oDataResult);

var aDocuments = xyz_homepage.xyz_homepage.src.odata.getDocumentsProd(iNumber);

this.oModelDocuments.setData(aDocuments);

//Call bom routine and set data

var oProductHead2BoM = xyz_homepage.xyz_homepage.src.odata.getProductHead2BOM(iNumber);

this.oModelProductHead2BoM.setData(oProductHead2BoM);


So when i debug and click on function ".getDocumentsProd" i can find the function which is reference to odata.js



Odata.js



getDocumentsProd Function



getDocumentsProd : function(iNumber){

var sNumber = iNumber.toString();
while (sNumber.length < 18) {
sNumber = "0" + sNumber
}
var vUriRead = "/DocumentsSet/?$filter=Material%20eq%20'" + sNumber + "'";

var oResult;

this.initODataModel( );
this.oDataModel.read(vUriRead, null, null, false, function(oData, oResponse) {
oResult = oData.results;
}, function(oError) {
jQuery.sap.log.error("OData-Error in function getDocumentsProd (EntityDocumentsSet)");
xyz_homepage.xyz_homepage.src.odata.displayRequestFailedMessage(oError);
});

return oResult;

},


On the same note i have for the getProductHead2BOM function.



getProductHead2BOM : function(iNumber){

var sNumber = iNumber.toString();
while (sNumber.length < 18) {
sNumber = "0" + sNumber
}


var vUriRead = "/ProductHeadSet('5199182')/ProductHead2BOM";
var oResult;

this.initODataModel( );

this.oDataModel.read(vUriRead, null, null, false, function(oData, oResponse) {
oResult = oData;
}, function(oError) {
jQuery.sap.log.error("OData-Error in function getProductHead2BOM (EntityProductHead2BOM)");
zplm_homepage.zplm_homepage.src.odata.displayRequestFailedMessage(oError);
});

return oResult;
}


I could see documents Odata but not for ProductsHeadBom



enter image description here







sapui5






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 '18 at 9:13







Rocket

















asked Nov 21 '18 at 14:34









RocketRocket

197




197












  • Can you share the fine structure and more code of the affected files?
    – Nandan Chaturvedi
    Nov 21 '18 at 15:21










  • Problem is that i don't see the function on sources(chrome) though it exists in IDE.
    – Rocket
    Nov 21 '18 at 15:55










  • You must import it somewhere to be able to use it.
    – Nandan Chaturvedi
    Nov 22 '18 at 3:02










  • use the require part of the controler to import the js file in which you function is
    – Erch
    Nov 22 '18 at 6:36






  • 1




    why is the part titled with view.XML still js code? i am confused
    – Erch
    Nov 22 '18 at 6:37


















  • Can you share the fine structure and more code of the affected files?
    – Nandan Chaturvedi
    Nov 21 '18 at 15:21










  • Problem is that i don't see the function on sources(chrome) though it exists in IDE.
    – Rocket
    Nov 21 '18 at 15:55










  • You must import it somewhere to be able to use it.
    – Nandan Chaturvedi
    Nov 22 '18 at 3:02










  • use the require part of the controler to import the js file in which you function is
    – Erch
    Nov 22 '18 at 6:36






  • 1




    why is the part titled with view.XML still js code? i am confused
    – Erch
    Nov 22 '18 at 6:37
















Can you share the fine structure and more code of the affected files?
– Nandan Chaturvedi
Nov 21 '18 at 15:21




Can you share the fine structure and more code of the affected files?
– Nandan Chaturvedi
Nov 21 '18 at 15:21












Problem is that i don't see the function on sources(chrome) though it exists in IDE.
– Rocket
Nov 21 '18 at 15:55




Problem is that i don't see the function on sources(chrome) though it exists in IDE.
– Rocket
Nov 21 '18 at 15:55












You must import it somewhere to be able to use it.
– Nandan Chaturvedi
Nov 22 '18 at 3:02




You must import it somewhere to be able to use it.
– Nandan Chaturvedi
Nov 22 '18 at 3:02












use the require part of the controler to import the js file in which you function is
– Erch
Nov 22 '18 at 6:36




use the require part of the controler to import the js file in which you function is
– Erch
Nov 22 '18 at 6:36




1




1




why is the part titled with view.XML still js code? i am confused
– Erch
Nov 22 '18 at 6:37




why is the part titled with view.XML still js code? i am confused
– Erch
Nov 22 '18 at 6:37












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53414392%2fdata-binding-to-the-table-error-is-not-a-fucntion%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53414392%2fdata-binding-to-the-table-error-is-not-a-fucntion%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Wiesbaden

Marschland

Dieringhausen