Jump to content

Return Focus To Previous Form Controls after close the Top Form


molla2005b

Recommended Posts

Hi , i would like to  Return Focus To Previous Form Controls after close the Top(Modual) Form:

 

ex :

I Open Form1 and Open Form2 Thru Form1.I want to return Focus to Form1 control After Close Form2

I try with setFocus and WebFocus and UniSession.AddJS and SetActivate

  but not work.

 

I upload a test case Download

 

Best regards.

Link to comment
Share on other sites

Hi,

 

For now try:

 

For example:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniForm1.ShowModal
  (
     procedure(sender:TComponent;Res:Integer)
     begin
       //ed1.WebFocus;
       UniSession.AddJS('setTimeout(function(){'+ ed1.JSName +'.focus()}, 100)');
     end
  );
end;

Best regards.

  • Upvote 1
Link to comment
Share on other sites

  • 1 year later...

Hi,

 

For now try:

 

For example:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniForm1.ShowModal
  (
     procedure(sender:TComponent;Res:Integer)
     begin
       //ed1.WebFocus;
       UniSession.AddJS('setTimeout(function(){'+ ed1.JSName +'.focus()}, 100)');
     end
  );
end;

Best regards.

 

I'm having problems using mobile,
In mobile setfocus is not working
I tried using this method but in mobile it does not work
 
Leandro
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...