Jump to content


Photo

FormA, FormB, FormC, FormD - How can FormD call FormB and execute procedure


  • Please log in to reply
5 replies to this topic

#1 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 346 posts
  • LocationMelbourne Australia

Posted 07 February 2018 - 05:17 AM

FormA calls FormB which calls FormC which calls FormD via ShowModal.

 

Is this the best way to call FormB from FormD and execute my desired procedure ?

 

procedure TFormD.UnimFormTitleButtonClick(Sender: TUnimTitleButton);

begin
  case Sender.ButtonId of
      0:  begin
             // Seperator
           end;
      1:  begin

             FormB.Show;

             UniSession.AddJS('ajaxRequest(FormB.HTMLFrame, "_FormDRequest", []);');
             ...
 
 
 
procedure TFormB.UnimHTMLFrameAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings);
begin
  if SameText(EventName, '_FormDRequest') then begin
    ...

 

 

 

After executing and building the necessary data in FormB for FormD I want to return to FormD and remove this activity from history so when the FormD Close Button is executed it takes me back to FormC.


  • 0

Andy


#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4969 posts

Posted 07 February 2018 - 08:59 AM

Hi,

if I understand you correctly, maybe you just need to use a callback ?
  • 0

#3 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 346 posts
  • LocationMelbourne Australia

Posted 07 February 2018 - 05:24 PM

Could you show me how please because if I do not use FormB.Show; before the ajaxRequest(FormB.HTMLFrame, "_FormDRequest", []); it says FormB does not exist ?


  • 0

Andy


#4 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4969 posts

Posted 07 February 2018 - 05:46 PM

Hi,

 

I'm sorry, it seems I did not correctly understand your question, please can you clarify again ?!


  • 0

#5 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 346 posts
  • LocationMelbourne Australia

Posted 08 February 2018 - 05:34 AM

I have approached this from another angle - thanks anyway.


  • 0

Andy


#6 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4969 posts

Posted 08 February 2018 - 05:45 AM

Ok, no problem


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users