Jump to content

Mobile Application Set Focus


N.Marzio

Recommended Posts

procedure TxFrmMage.cmdSelez(Sender: TObject; var Key: Word;Shift: TShiftState);
var
  lVal : string;
  lMsg : string;
  lNum : integer;
begin
  if (key = VK_F1) or (key = VK_F2) then begin
    cmdClose(nil);
  end;
  //
  if key <> VK_RETURN then exit;
  //

  //

  // I've tried every one of these possibilities

  //

  // 
  // Not Working !!
  activeControl := edtEti;// <--- TUnimEdit
  //
  // Not Working !!
  UniSession.AddJS('setTimeout(function(){' + edtEti.JSName + '.focus()}, 100)');
  //
  // Not Working !!
  edtEti.JSInterface.JSCall('focus', [])
  //
  //
end;

Link to comment
Share on other sites

Sorry but what do you mean by test?
Looking at the example above, in none of the following cases
  //
   // Not Working !!
   activeControl := edtEti;// <--- TUnimEdit
   //
   // Not Working !!
   UniSession.AddJS('setTimeout(function(){' + edtEti.JSName + '.focus()}, 100)');
   //
   // Not Working !!
   edtEti.JSInterface.JSCall('focus', [])

The focus is returned to the requested field.
The problem occurs on all browsers on mobile devices
and also on desktop.

What other case should I do?

Thank you

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...