IW 15.5.5 PerformAfterAsyncProcessing(); formClass is not defined

<< Click to Display Table of Contents >>

Navigation:  Forum >

IW 15.5.5 PerformAfterAsyncProcessing(); formClass is not defined

Forum link

 

 

 


 

01-11-2024, 08:53 AM:

 

With IntraWeb 15.5.4 (and .5) for an ISAPI.DLL we sometimes get a JavaScript console error (in FireFox F12) that says:

 

Error in processAjaxExecute when evaluating: PerformAfterAsyncProcessing(); formClass is not defined

 

The error can be trace to the IWBase_xxxx.js file. 

 

This does not happen with IntraWeb 15.4.2. Any idea? We haven't changed anything else.

 

Note that it looks like everything on the page itself is still working, but I want to ensure everything is fine before we deploy this version.

 

Thanks in advance!

 

Groetjes, Bob Swart

 

 

 


 

01-12-2024, 10:43 PM:

 

Hi Dr. Bob,

 

I'll have a look. Did you ever get it in SA mode while debugging/developing?

 

Cheers

 

 

 


 

01-12-2024, 11:09 PM:

 

PerformAfterAsyncProcessing() is not a method part of IntraWeb codebase. Is this your parts of your own code or 3rd parties?

 

 

 


 

01-12-2024, 11:22 PM:

 

PerformAfterAsyncProcessing() is a JavaScript function of our own, it is called in the DoGenerateForm of our main base form (derived from TIWAppForm, and the parent for all our other intraweb forms.

 

Code:

 

procedure TIWCaiwBaseForm.DoGenerateForm(AStream: TIWRenderStream);

 

begin

 

  inherited;

 

  if WebApplication.IsCallBack then

 

    WebApplication.CallBackResponse.AddJavaScriptToExecuteAsCDATA('PerformAfterAsyncProcessing();'#10);

 

end;

 

 

 

If looks like the above JavaScript is now added before the formClass value itself is present.

 

'formClass' is a javascript variabele which is set in our $(document).ready( ) function, based on the value of IW_FormClass.

 

Code:

 

formClass = $("input[name=IW_FormClass]").val()

 

 

 

IWForm.pas sends the IW_FormClass to the browser (line 821) in procedure TIWForm.DoGenerateForm:

 

Code:

 

Contents.AddHiddenField('IW_FormClass', Self.ClassName);

 

 

 

So my guess is that AddJavaScriptToExecuteAsCDATA may end up in the resulting page in a slightly different order using IW 15.5.x compared to IW 15.4.2 ??

 

 

 


 

01-16-2024, 05:11 AM:

 

I'll try to simulate it here and see how it goes.

 

 

 


 

01-16-2024, 08:49 AM:

 

Hi again Dr. Bob,

 

I'm having a little trouble recreating it... more specifically, how to you trigger the DoGenerateForm() on Async? Do you force a reload or any other specific action? Are you swiching forms?

 

 

 


 

01-16-2024, 04:17 PM:

 

I see the message when we enter a new page, as soon as that page is being loaded (which almost sounds like an Async event is happening at that time, I'lll see if I can figure this out on our end as well - but like I said, the same applications runs without this message using IW 15.4.2).

 

 

 


 

01-17-2024, 11:22 AM:

 

We seem to have solved it on our end by adding some more code to the DoGenerateForm using AddToInitProd, sorry to waste your time on this.