Problem with TXDataWebDataset on second use

My webcore app has a datamodule and 2 forms.

I have a dataset on the datamodule that is loaded in the OnCreate event, let's call it dataset1.

Also on the datamodule is dataset2. This uses dataset1 in its OnCalcFields event.

Form1 is loaded and this uses a Datasource to link dataset2 to a TWebDBGrid and works fine.

Form2 has a datasource that links dataset1 to another TWebDBGrid.

If I close and free Form 1 and also close dataset 2 and load Form 2 I get:

Uncaught TypeError: Cannot read property 'rows' of null | TypeError: Cannot read property 'rows' of null at Object.GetCellElements

This happens after the EndUpdate Call in AfterLoadDFMValues;

On Form 2 are some TWebDBEdit controls and I can see that they populate correctly.

If I close dataset 1 before creating Form 2 and open it in the Form 2 OnCreate then it is fine.

Any ideas? Thanks

Full Error Message

ERROR
Uncaught TypeError: Cannot read property 'rows' of null | TypeError: Cannot read property 'rows' of null at Object.GetCellElements (http://localhost:8000/SMXLicense/SMXLicense.js:67458:30) at Object.LoadData (http://localhost:8000/SMXLicense/SMXLicense.js:75495:21) at Object.ActiveChange (http://localhost:8000/SMXLicense/SMXLicense.js:75636:14) at Object.cb (http://localhost:8000/SMXLicense/SMXLicense.js:222:26) at Object.ActiveChanged (http://localhost:8000/SMXLicense/SMXLicense.js:72923:46) at Object.CheckActiveAndEditing (http://localhost:8000/SMXLicense/SMXLicense.js:46091:14) at Object.DataEvent (http://localhost:8000/SMXLicense/SMXLicense.js:46155:14) at Object.DistributeEvent (http://localhost:8000/SMXLicense/SMXLicense.js:46410:44) at Object.ProcessEvent (http://localhost:8000/SMXLicense/SMXLicense.js:46434:12) at Object.SetDataSet

Hard to guess without the source code. Do you have a sample project reproducing the issue?

I'll see if I can put one together. Just done lots of work arounds in the main project now.

1 Like