Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Putting text in a string var in a newly created form before showing it ?
#4
(03-04-2020, 11:04 AM)SorenJensen Wrote: Hi Karolm,

Thanks for your input.

The way to dynamically create forms, I've used before in VCL, using a var of type TForm, but never considered it wiith IW.

I'll give it a try and see if I can make it work.

Regards
Soren
Hi Soren,
My code for creating forms dynamically looks like this:

  mEditFilterForm := TcmEditFilterForm.Create(WebApplication);
  mEditFilterForm.Parent := self;
  mEditFilterForm.Show;

When you're done with the form, rather than calling free(), call

  mEditFilterForm.release();

This lets the form exist until the next form is rendered. That way variables / controls on the first form don't get freed while you're using them to populate values on the next form.

Also, unlike VCL, you can populate values on the form anytime after creation and before rendering.  So you can even change form controls after calling .show().  This is because .show() just sets visible to true.  In the VCL, the form would render at that moment and then the values would change in front of the user.  In Intraweb, the form is displayed until the call returns.  So you can make changes anytime and they will all be rendered when the call returns.

Pete
Reply


Messages In This Thread
RE: Putting text in a string var in a newly created form before showing it ? - by pete@pdmagic.com - 03-04-2020, 06:10 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)