scottiwillis
Forms Fledgling

Issue with lookup change event firing on form load - Nintex forms version 2.7

Jump to solution

Hi there Nintex community,

 

I am having an issue with the Nintex forms lookup list controls change event handler, whereby the event handler is firing as the form is loading. The handler have alerts that are displayed are fired on change of the selected item, so these are being show as the form is loading, which is not good

 

I searched the Nintex forums for the issue and found a couple of posts indicating that in newer version of Nintex Forms, the lookup control has been changed to load data asynchronous after page loaded. So based on this I moved the registration of the handler to NWF.FormFiller.Events.RegisterAfterReady. I also added;

 

NWF.FormFiller.Events.RegisterAfterReady(function () {

 

 

 

    var EngagementType = NWF$('#' + ddlEngagementType);

    EngagementType.change(function (e) {

        if (e.originalEvent!=undefined){

            if (EngagementType.val()!="")

            {

                alert("Engagement type changed");

            }

 

I also read in a post that the lookup change event fires (ie when data fetched and populated, it's a change), you check if it is triggered by forms or human (using e.originalEvent check), and if value is empty (means the Please Select... on dropdown list type lookup). So I added these conditions to the events register on change.

 

However, the alert is still firing when the form is launched in edit mode. In fact, the change event is fired 3 times when the form is loaded in edit mode;

 

1) EngagementType.val is "" and e.originalEvent id defined

2) EngagementType.val is "13" and e.originalEvent id defined (alert displayed)

3) EngagementType.val is "13" and e.originalEvent id undefined

 

I really need the change event registered after the form lookup control has been loaded with data and selected value set by the form load. Alternatively is there a way to check if the event is initiated by the user or the form, as the value of e.originalEvent is actually defined for the first 2 calls as above.

 

Can anyone provide some insight to this issue?

 

Thanks,

Tags (1)
0 Kudos
Reply
12 Replies
sophie_timu
Nintex Employee
Nintex Employee

Re: Issue with lookup change event firing on form load - Nintex forms version 2.7

Jump to solution

Dear Scott,

We have received your email here in Support. We will investigate your enquiry and be in touch via email very soon.

0 Kudos
Reply
rickbakker
Nintex Newbie

Re: Issue with lookup change event firing on form load - Nintex forms version 2.7

Jump to solution

Hello,

I just noticed the same with Nintex Forms 2.9.0.0.

As a workaround, I am investigating using JavaScript which looks promising.

0 Kudos
Reply
themos
Nintex Newbie

Re: Issue with lookup change event firing on form load - Nintex forms version 2.7

Jump to solution

Any updates on this?

0 Kudos
Reply
scottiwillis
Forms Fledgling

Re: Issue with lookup change event firing on form load - Nintex forms version 2.7

Jump to solution

We contacted Nintex support and were advised that there was a known issue with the onchange event for the Lookup lists. The Lookup control populates and has the selected value set asynchronously after the form is loaded. They suggested as a workaround that we import the legacy List Lookup and then use List Lookup V1 control on the forms until the issue is addressed.

So using List Lookup V1 fixed the issue. The legacy list lookup V1 and current list lookup can both be used on a form.

I can post the steps used to import the legacy lookup if needed.

Cheers,

Scott.

View solution in original post

Reply
xMikeX
Automation Master
Automation Master

Re: Issue with lookup change event firing on form load - Nintex forms version 2.7

Jump to solution

Hey Scott Willis,

I remember the old List Lookup having a "page reload" occur when used in a "cascading" manner with other list lookup controls.   You might want to make sure you won't be affected by this (or at very least it doesn't bother you) if you are going to use it. 

Thanks,

mike

Reply
Not applicable

Re: Issue with lookup change event firing on form load - Nintex forms version 2.7

Jump to solution

Hi, Scott Willis​, it'd be swell if you are able to share the steps.

Thanks!

Frank

Your community manager

0 Kudos
Reply
emha
Automation Master
Automation Master

Re: Issue with lookup change event firing on form load - Nintex forms version 2.7

Jump to solution

Scott Willis​, is lookup V1 be compatible with other NINTEX controls resp functionality?

I mean, apart from placing it on the form and connecting it to a list field, can you eg. reference lookup V1 control in rules or formulas?

from my experience nintex just allows to place sharepoint native controls on the form and that's all.  if one need to relate them to nintex ones, it's really a pain.

however, I haven't worked with lookup V1, so I'm just curios.

Reply
scottiwillis
Forms Fledgling

Re: Issue with lookup change event firing on form load - Nintex forms version 2.7

Jump to solution

Hi Frank,

Nintex Support sent me the following to import the legacy List Lookup;

1.      On the Central Administration home page, click Nintex Forms Management.

2.      On the Nintex Forms Management page, click Manage Form Controls.

3.      Under the Form Control Types table, in the Import text box, enter the following text:

Nintex.Forms.SharePoint.FormControls.SharePointLookupFormControlV1, Nintex.Forms.SharePoint, Version=1.0.0.0, Culture=neutral,PublicKeyToken=c52d764dcf7ec883

4.      Click Import.

Cheers,

Scott

Reply
scottiwillis
Forms Fledgling

Re: Issue with lookup change event firing on form load - Nintex forms version 2.7

Jump to solution

Mike,

Yes, you are correct, List Lookup V1 does have a "page reload" occur when used in a "cascading" manner. So I didn't use it on the cascading lists. Fortunately the cascading lists did not have any "obvious" onchange events that fired on page load.

Scott

Reply