Question
Last activity: 28 Apr 2016 22:47 EDT
registerOnBeforeSubmit adds the same doBeforeSubmit function multiple times
Hi,
We've got a customized version of the multiselect control. As part of that, we have added a line to register the doBeforeSubmit function via registerOnBeforeSubmit.
I noticed that the doBeforeSubmit function is being called multiple times depending on how many times I've refreshed the screen. I checked via the console if the contextObjects are equivalent and it comes up false. However, the contextObjects entries attributes (prototype, _handle, _select and _startingLength) are equal.
Do you know if there's a fix for this?
This is the code for the multiselect where registerOnBeforeSubmit is being called. It is really the same as the original one in pega_ui_multiselect.js
pega.ui.MultiSelect = function(handle, startingLength)
{
this._handle = handle + "$l";
this._select = handle;
this._startingLength = startingLength;
pega.u.d.registerOnBeforeSubmit(this.doBeforeSubmit, this);
}
We're using Pega v6.2 SP2.
Thanks,
Rachel
Hi,
In addition to the above, I was researching on javascript comparisons. It seems that the function pega.u.d.registerOnBeforeSubmit has an issue during comparison of the objects.
I tried to add a flag to check if the context object and function exists in pega.u.d.contextObjects and pega.u.d.onSubmits respectively. However, I got an access error when I did that.
Any ideas guys? Or maybe there's already a hotfix for this one?
Thanks,
Rachel