Strange behaviour calling a TWEBForm

Hi ,

again i see myself faced to a strange behaiviour...
After searching quite a long time, i decided to use the swarm intelligence....

we designed a TWebForm in webcore, with additional designing in HTML, and when i call this form from my MainForm, it looks fine :ok_hand:

calling method :

Blockquote

procedure THBMMainT.cm_DecisionClick(Sender: TObject);

var LPrjFormsDescisionData : TPrjFormsDecisionData;
procedure AfterCreate(AForm: TObject);
begin
if Assigned(LPrjFormsDescisionData) and (LPrjFormsDescisionData is TPrjFormsDecisionData) then
begin
window.location.hash := 'TPrjFormsDescisionData'; // used to manage Back button handling to close subform
( LPrjFormsDescisionData as TPrjFormsDecisionData ).CallingForm := wxFrmPeriodenKalkulationTLN;
( LPrjFormsDescisionData as TPrjFormsDecisionData ).spedPeriode.Enabled := false;
( LPrjFormsDescisionData as TPrjFormsDecisionData ).spedKrankenhaus.Enabled := false;
( LPrjFormsDescisionData as TPrjFormsDecisionData ).spedAbteilung.MaxValue := AktAnzAbtl;
( LPrjFormsDescisionData as TPrjFormsDecisionData ).spedAbteilung.MinValue := 1;

  ( LPrjFormsDescisionData as TPrjFormsDecisionData ).Init;
  ( LPrjFormsDescisionData as TPrjFormsDecisionData ).Caption  := cVK_EDatTxt;
end;

end;
procedure AfterShowModal(AValue: TModalResult);
begin
( LPrjFormsDescisionData as TPrjFormsDecisionData ).Done;
// btnPrint.Enabled := (( LPrjFormsDescisionData as TPrjFormsDecisionData ).ModalResult = mrOk);
end;
begin
LPrjFormsDescisionData := TPrjFormsDecisionData.CreateNew(@AfterCreate);
LPrjFormsDescisionData.ShowModal(@AfterShowModal);
end;

Blockquote

so far so good. Now my problem, as soon as i call this form from a different form than the main form, i get this result :

just to describe the the order of calling more detailled :
MainForm -> calling Form1 - > calling TPrjFormsDecisionData => bad result

MainForm -> calling TPrjFormsDecisionData => good result

It seems that the HTML changes done to the form TPrjFormsDecisionData are not considered when using the "Bad way" of calling.

any idea what might go wrong ???

br
Michael

Based on the screenshots I cannot judge.
Is the HTML of the form not loaded at all or is it just partially loaded?
Is there something with Form1 that is significantly different from MainForm?

Dear Bruno,

we found the problem....

We used the same ElementID's on the forms, as a Default Layout for our application.

Changig the ElementID to be unique solved the problem....

br
Michael

1 Like