Determine if you have custom renderer code that contains control event binding of the following types:
CustomPhysicalRenderer.prototype.BindEvents = function () {
var controlSet = this.GetPM().Get("GetControls");
for (var controlName in controlSet) {
if (controlSet.hasOwnProperty(controlName)) {
var control = controlSet[controlName];
if (control.GetName() === "Probability") {
$('[name="' + control.GetInputName() + '"]').on("click", { ctx: this }, function () {
event.data.ctx.GetPM().OnControlEvent(("PROBABLITY_CLICK"));
});
}
}
}
SiebelAppFacade.CustomPhysicalRenderer.superclass.BindEvents.call(this);
};
In this code, the complete set of controls is obtained from the framework PM property and the render is looping through set. Upon encountering a particular control by the repository name Probability
, a click event handler is being bound to the DOM element representing that control which then triggers the event PROBABILITY_CLICK
on to the PM. Eventually, a custom handler is attached as a customized presentation model using the AttachEventHandler
API.
Modify the code located in Step 1 to resemble the following code:
CustomPhysicalRenderer.prototype.BindEvents = function () {
var eventHelper = SiebelApp.S_App.PluginBuilder.GetHoByName("EventHelper"),
controlSet = this.GetPM().Get("GetControls"),
controlEl = null;
for (var controlName in controlSet) {
if (controlSet.hasOwnProperty(controlName)) {
var control = controlSet[controlName];
if (control.GetName === "Probability") {
controlEl = this.GetUIWrapper(control).GetEl();
if (controlEl.length && eventHelper) {
eventHelper.Manage(controlEl, "click", { ctx: this }, OnClickProbability);
}
}
}
}
SiebelAppFacade.CustomPhysicalRenderer.superclass.BindEvents.call(this);
};
function OnClickProbablility(){
event.data.ctx.GetPM().OnControlEvent(("PROBABLITY_CLICK"));
}