Strange TWebForm events on TWebForm.Create

we have a strange calls on events on TWebForm.Create:

I have a TWebForm(Form1) that call another TWebForm(Form2) that contain some TWebDBEdit.
I need to use TWebDBEdit's events OnEnter and OnExit when user edit with those editors.

If I create Form2 in this modality:

Form2 := TForm2.Create(Self) ;
await(TForm2, Form2.Load());
   await(TModalResult, Form2.Execute);
   if Assigned(Form2) then

the events OnEnter and OnExit of all TwebDBEdit are called ALSO when the Form2 are showed.

If I create Form2 in this modality

Form2 := TForm2.CreateNew(@AfterCreate);

the events OnEnter and OnExit of TWebDBEdit are called at the effective enter or exit by user activity and not when the form are showed.

Please, can you explain why?
How I can create a form same as first modality without OnEnter and OnExit events are called?
Thanks in advance

I cannot see a reason from this description.
Please isolate this into a sample source project with which this can be reproduced and send this with clear detailed steps how to reproduce.

Ok, Bruno. Demo in attach...
Good Job (3.3 MB)

In your form, every TWebDBEdit has TabStop = true and TabOrder = 0.
It wants to auto focus the first control but there are multiple 'first controls', hence the issue.
Setting the TabOrder to unique/correct values solves the problem.

Hi Bruno, ok.
Uhm...however the two systems work differently.
Ok, I assumed that the TabOrder handled automatically as in the VCL.
Good job

Normally, when you add new controls on the form, the IDE should handle the TabOrder automatically (like it does in VCL apps). It was strange that for you these were all zero.

Hi Bruno,
I tried to add some component on the webform and I noticed that some components have property TabOrder valorized, some components not.

I added to my webform:

  • TWebEdit: TabOrder isn't valorized;
  • TWebDBEdit: TabOrder isn't valorized;
  • TMSFNCEdit: TabOrder is valorized;
  • TWebButton: TabOrder isn't valorized;
  • TWebDBGrid: TabOrder is valorized;
  • TMSFNCGrid: TabOrder is valorized;
  • TWebCheckBox: TabOrder isn't valorized;
  • TMSFNCCheckBox: TabOrder is valorized;

I suppose that there is an anomaly in some web component (or in my Delphi installation?).
I have TMS WEB CORE v1.9.7.0 installed

Thanks for reporting.
We could trace & solve this issue. The next update will address this.