nuOpenForm issues after saving parent form

nuOpenForm issues after saving parent form

Postby mobilemcclintic » Fri Aug 25, 2017 5:56 am

TL:DR
Using nuOpenForm on a subform grid's record after saving the main form makes it so I can't go back to the main form.

Hello,
I have a main form (A), with a grid subform (B). I am using the below code to open an edit form (B) for the records in the subform (B).
The opened edit form (B) contains fields that are on the main form's (A) subform grid (B) as well as quite a few other ones.

function openItem(t){

var rw = $('#' + t.id).attr('data-prefix'); //-- current row in subform
var id = rw + '_nuPrimaryKey'; //-- Primary Key for record in subform
var fpk = '5915002745f94d7'; //-- Form Primary Key
var rpk = $('#' + id).val(); //-- Record Primary Key

// window.nuControlKey = true; //-- simulate holding down CRTL (open in new Tab) <--- didn't work for me, so commented it out

nuOpenForm('#FORM_ID#', '#RECORD_ID#', fpk, rpk);
// nuOpenFormInFrame(fpk, rpk);

// window.nuControlKey = false; <--- didn't work for me, so commented it out
}

if I use nuOpenForm, one of two things happen
If I have not opened and saved the main form (A) before opening the edit form for (B), I can open records (b) and save them, and I can close the form and go back to (A) where the records in subform (B) are updated.
If I have opened and saved form (A) before opening the edit form, whether I make changes or not, when I click to go back to the previous form (A) using the breadcrumb, nothing happens.
If I click on the breadcrumb a second time, I get "Uncaught TypeError: Cannot read property 'call_type' of undefined at nuBuildForm at nuGoToForm at HTMLSpanElement.onclick" in the console.
If I attempt to change a field on form (B) I get Uncaught TypeError: Cannot read property 'edited' of undefined at nuSetEdited at HTMLInputElement.onchange.

If I used nuOpenFormInFrame,
I can open form (B), save records and close the window, but the data doesn't update on form(A)'s subform (B). When I hit save on form (A), the values already on the subform (B) save over the top of what was entered in the edit form for (B).

If I use nuOpenForm after saving form (A), and save form(B), I can call another function of nuOpenForm on an Extra action button, but then I have 2 extra breadcrumbs and it still doesn't always work.
mobilemcclintic
 
Posts: 53
Joined: Fri Oct 23, 2015 8:04 am

Re: nuOpenForm issues after saving parent form

Postby jens » Wed Dec 13, 2017 9:39 pm

Have you found a solution?

I've got the same error now (I think this was not the case before doing 'git pull' and getting the latest snapshot of Version 3). I have no custom js code, but whenever I hit the parent table from an "Add Record" screen: First nothing happens, then on second click the browser console says: "Uncaught TypeError: Cannot read property 'call_type' of undefined" (Chrome) or "TypeError: w is undefined" (Firefox).
jens
 
Posts: 6
Joined: Fri Apr 14, 2017 7:04 pm

Re: nuOpenForm issues after saving parent form

Postby jens » Thu Dec 14, 2017 5:28 am

I just noticed, that clicking on the parent table in the breadcrumb lasts for about 20 seconds (my table has about 2000 records). If I click within this time a second time, then it takes this long. So it is also a severe performance problem here.
jens
 
Posts: 6
Joined: Fri Apr 14, 2017 7:04 pm


Return to Custom Code



cron