Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Unable To Get Property 'tcontrol_getdisplayorder' of undefined or null reference
Wed, Jul 5 2017 4:49 AMPermanent Link

Frederick Chin

I have attached a project that displays the above error message.

1.   Run project
2.   Click "Call Form 2"
3.   Click "Call Form 3"
4.   Click the Cancel button.
5.   Program crashes.

I can't tell which line is causing the problem.

--
Frederick



Attachments: test4.zip
Wed, Jul 5 2017 5:10 AMPermanent Link

Uli Becker

> I can't tell which line is causing the problem.

You can if you open the js file and have a look at the indicated line:

tempform = $t.tsurface_getactiveform();
The following line causes the error.
$t.tsurface_fmodaloverlay.tcontrol_setdisplayorder(tempform.tcontrol_getdisplayorder());

The problem is that you hide the calling form(s) and produce problems
with the modal overlay.
It doesn't make sense to do so when you use ShowModal to display another
form.
If you don't want the calling form to be visible, just use "show"
instead of "showmodal". Then you can hide the calling form.

Uli
Wed, Jul 5 2017 10:53 AMPermanent Link

Frederick Chin

Uli,

/*
You can if you open the js file and have a look at the indicated line:

tempform = $t.tsurface_getactiveform();
The following line causes the error.
$t.tsurface_fmodaloverlay.tcontrol_setdisplayorder(tempform.tcontrol_getdisplayorder());

The problem is that you hide the calling form(s) and produce problems
with the modal overlay.
It doesn't make sense to do so when you use ShowModal to display another
form.
If you don't want the calling form to be visible, just use "show"
instead of "showmodal". Then you can hide the calling form.
*/

Thanks. The change solved the problem.

--
Frederick
Wed, Jul 5 2017 11:20 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Frederick,

Okay, I put a check in there (TSurface.EndModal) on the active form to make sure that it's assigned, and that avoids the fatal error and allows your application to work as necessary.

However, in general, you should avoid messing with the visibility of modal dialogs and stick with showing/closing them in order to avoid such issues.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Jul 5 2017 11:40 AMPermanent Link

Frederick Chin

Tim,

/*
Okay, I put a check in there (TSurface.EndModal) on the active form to make sure that it's assigned, and that avoids the fatal error and allows your application to work as necessary.

However, in general, you should avoid messing with the visibility of modal dialogs and stick with showing/closing them in order to avoid such issues.
*/

Thanks for the advice.

--
Frederick
Image