[英]Error is undefined when to callback function not throwing error
var callback = dojo.lang.hitch(this, this.getCallbackReview); //This is used to call callback funstion after line2
this.service.ReviewManager.getReview(callback, path, ItemPath, true); //use to call java method which returns Pojo
//This is callback function
getCallbackReview: function(info, error) {
if(error) {
alert(error); //in case of any error from the java method
return;
}
alert(info); //If no error thrown from Java Method
},
The second is not throwing any error and returning proper info but if this info has clob
field then giving me error as undefined. 第二个方法是不抛出任何错误并返回正确的信息,但是如果此信息具有
clob
字段,则给我未定义的错误。
In this line of code: 在这行代码中:
var callback = dojo.lang.hitch(this, this.getCallbackReview);
You pass as as scope this.getCallbackReview
but this property is not defined in your code snippet. 您将
this.getCallbackReview
作为范围传递,但此属性未在代码段中定义。 To fix it you should consider adding getCallbackReview
as property so 要修复它,您应该考虑将
getCallbackReview
作为属性添加,以便
this.getCallbackReview = function(info, error) {
...
},
or alternativelly: 或者:
var callback = dojo.lang.hitch(this, getCallbackReview);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.