.html is requested for direct forms if created with create/CreateNew

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?

Thank you in advance

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.

I have the same problem with the following, where I do not use a Load

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.....

Did you check:

Yes I had watched it.

So, please implement it the way it is demonstrated in this video.

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?

Thank you in advance

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.

1 Like

Thank you Bruno. Happy birthday for yesterday!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.