Jump to content

Movile What is the Correct Way to use ShowModal


asapltda

Recommended Posts

Hi I'm using the following procedure displaying a modal form .

 

The form is called must provide the client code that is going to work and back using a shared drive for both forms

 

 
In the desktop version of the method works, but in mobile form does not work. What is the Right Way?

 

 

 

  g_cliente:='';
  UnimTimer1.Enabled :=TRUE;
FPARAMETROSGENMVL.ShowModal(
    procedure(sender: TComponent; Result: Integer)
      var
      i:Integer;
   begin
     if Result = mrOk then begin
       BTN_CONFIGURACION.UI := 'action';    
       UnimBitBtn1.UI       := 'action';
       UnimBitBtn1.Caption := CONFIGURACIONPARMS.O_CLIENTE;
       cliente.Text        := CONFIGURACIONPARMS.O_CLIENTE;
       CLIENTEL.Caption    := CONFIGURACIONPARMS.O_CLIENTE;
       CLIENTEL.Visible    :=TRUE;
       g_cliente:=  CONFIGURACIONPARMS.O_CLIENTE;
     end;
     if Result = mrcancel then begin
        cliente.Text        := 'NO DEFINIDO';

     end;

   end);
end;
 
 
--------- SHARE UNIT ---
Unit CONFIGURACIONPARMS;
 
interface
var
  G_Usuario       :String;
  g_PassW         :string;
  P_USUARIO       :STRING;
  O_CLIENTE       :string;
  O_CLIENTESHP    :string;
 
  Procedure SET_INICIAR_VALORES;
 
implementation
 
Procedure SET_INICIAR_VALORES;
Var
  W_Null:Variant;
BEGIN
  //P_RECURSO    :='';
End;
 
END.

 

Link to comment
Share on other sites

It seems that this form of call and receive another form parameters using a unit is only valid when the form is called a second and more times
The first time is not running the callback to the form not the callback is executed,
  in the second and subsequent calls brings modicada field values defined in the unit using the callback
It will be a mistake of the components?

 

Link to comment
Share on other sites

 

BTW, you are using global variables in shared unit which you must totally avoid in uniGUI. Put your globals vars in mainModule

 

 

Modify the procedure for passing variables between forms using mainmodule , and so the edit / label defined in the main form is updated with the contents of the variables that were modified by the form daughter

 

Case solved

muchas gracias

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...