मेरे पास निम्नलिखित है (Tridion PowerTools से), जो कुछ जावास्क्रिप्ट चलाते समय CoreService से उपयोगकर्ता नाम प्राप्त करता है।एंगुइला जावास्क्रिप्ट से डब्लूसीएफ वेब विधि को कॉल करते समय इन सभी पैरामीटर का क्या अर्थ है?
जावास्क्रिप्ट (एंगुइला):
PowerTools.Popups.Example.prototype._onbtnGetUserInfoClicked = function() {
var onSuccess = Function.getDelegate(this, this._handleUserInfo);
var onFailure = null;
var context = null;
//call function
PowerTools.Model.Services.Example.GetUserInfo(onSuccess, onFailure,
context, false);
};
// Delegate function "onSuccess"
PowerTools.Popups.Example.prototype._handleUserInfo = function (response) {
var p = this.properties;
$j("#lblUserInfo").text(response.UserName);
};
CoreService पक्ष:
PowerTools.Model.Services.Example.GetUserInfo(onSuccess, onFailure, context, false)
[OperationContract, WebGet(ResponseFormat = WebMessageFormat.Json)]
public ExampleData GetUserInfo()
{
var coreService = Client.GetCoreService();
_exampleData = new ExampleData()
{
UserName = coreService.GetCurrentUser().Title
};
return _exampleData;
}
यह एक अतुल्यकालिक कॉल भेजता है
जबकि इस प्रतिक्रिया को संभालने के लिए एक अलग समारोह प्रदान करती है: PowerTools.Model.Services.Example.GetUserInfo(onSuccess, onFailure, context, false)
:
Function.getDelegate(this, this._handleUserInfo)
लेकिन जहां onSuccess, onFailure, संदर्भ, और बूलियन में से आता है?
यह चार-पैरामीटर हस्ताक्षर सेवा कोड में नो-पैरामीटर GetUserInfo() से मेल नहीं खाता है। वह आदेश और इन चार क्यों?
संपादित कुछ है के बारे में उलझन में था। –