Trying to create a direct form with the following line works OK during development...
userlogin:=Tuserlogin.Create(self);
userlogin.Popup:=true; try
await(Tuserlogin,userlogin.Load);
res:=await(integer,userlogin.execute);
But when I put it in a web server I am getting the following:
looking in dev tools from the browser, I am getting the following:
The same happens if I created a direct form like the following:
emform:=tfirststep.CreateNew(rightwin.ElementID,@aftercr);
I noticed that there is a TApplicationHelper.CreateFormDirect but I can not find an alternative for embedded forms like the above.
Do Direct Forms are created only with application.createformdirect?
You use userlogin.Load , so this attempts to fetch the HTML for the form, i.e. this isn't the concept of a direct form that does not use a HTML template file.
Something unexpected I noticed also is that TWebForm.OnCreate event from the above form tfirststep is fired after the aftercr event above.
From an inheritance type of view, TWebForm.OnCreate is part of the "creation" of the tfirststep form, so a TFormCreatedProc should follow.....
This video is about an one (direct) form application with no extra direct form to show how you can create and open a second one.
So, as I can understand only Tapplication helper TApplicationHelper.CreateFormDirect can create a direct form and this form can not be embedded.
Concerning the following, is it ok?
At this moment, TApplication.CreateFormDirect() creates the form in the scope of the DOM body. We'll make an override to allow to create it in the scope of any HTML element by Id.
OnCreate of the form is by design triggered when the form is created, including a possible asynchronous load process of the form HTML template. The proc parameter is called when the form instance has been created.