03-04-2020, 06:10 PM
(03-04-2020, 11:04 AM)SorenJensen Wrote: Hi Karolm,Hi Soren,
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
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

