Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Using handlers and creating the same form multiple times


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Jan 11, 2015 7:10 AM Last Post By: Alexandre Machado
John Sklavounos

Posts: 2
Registered: 5/19/98
Using handlers and creating the same form multiple times  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 27, 2014 11:08 PM
Hello All,

I'm learning about THandlers by using the ContentHandlersDemo and have changed the example to open the forms in new windows and I've changed the button code in the red form to change the form title from one value to another when clicked. It seems that the forms created are really referencing the same form.

I've come to this conclusion because when you create multiple Red forms and then press the button on only one - when you refresh the other created forms they change the title without having to click the button.

Is there any way to actually create unique forms? I can upload my modified demo project if that would help.

Environment:
Windows 8.1 64 bit
IW 14.0.32
Delphi XE6 Update 1
CGDevTools 2.3.0.89

Browsers:
Chrome 39.0.2171.95 m
Firefox 34.0.5
Opera 26.0.1656.60
IE 11.0.9600.17498

Thank you,
John
Alexandre Machado

Posts: 1,754
Registered: 8/10/13
Re: Using handlers and creating the same form multiple times  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 11, 2015 7:07 AM   in response to: John Sklavounos in response to: John Sklavounos
John Sklavounos wrote:
Hello All,

I'm learning about THandlers by using the ContentHandlersDemo and have changed the example to open the forms in new windows and I've changed the button code in the red form to change the form title from one value to another when clicked. It seems that the forms created are really referencing the same form.

I've come to this conclusion because when you create multiple Red forms and then press the button on only one - when you refresh the other created forms they change the title without having to click the button.

Is there any way to actually create unique forms? I can upload my modified demo project if that would help.

Environment:
Windows 8.1 64 bit
IW 14.0.32
Delphi XE6 Update 1
CGDevTools 2.3.0.89

Browsers:
Chrome 39.0.2171.95 m
Firefox 34.0.5
Opera 26.0.1656.60
IE 11.0.9600.17498

Thank you,
John

Set the property UseExistingInstance (of your TContentForm instance) to FALSE. The default is true. Then it will create a new instance each time that is called. Have in mind that you should release those instances yourself, otherwise the active form list will grow, and grow....

I mean, when the session terminates, each instance will be released, just like any normal IWForm which owner is WebApplication. But, if the user can continually create instances (e.g. clicking on a button), then you are potentially exposing a feature that let the user create, say, 1000 instances of some form, you see?
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02