bbm Posted July 31, 2018 Share Posted July 31, 2018 Hi, when I open a new frame to enter new data, I want to set the focus on a special uniEdit component. How can I do that? The UniEdit.SetFocus does not work. Best regards 1 Quote Link to comment Share on other sites More sharing options...
belo Posted July 31, 2018 Share Posted July 31, 2018 procedure TUniFrame1.UniFrameCreate(Sender: TObject); begin UniEdit1.SetFocus; end; Quote Link to comment Share on other sites More sharing options...
bbm Posted July 31, 2018 Author Share Posted July 31, 2018 Hi, thank you, but this is not working. The UniEdit is part of a UniFieldSet. Could this be the problem? Best regards Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 31, 2018 Share Posted July 31, 2018 Hi, Is the text field read-only? Quote Link to comment Share on other sites More sharing options...
bbm Posted July 31, 2018 Author Share Posted July 31, 2018 Hi, no. Currently I made a work arround. I create an ajax event in the afterrender ExtEvent. Then I can use the UniEdit.SetFocus in the OnAjaxEvent. Thank you all. Best regards Quote Link to comment Share on other sites More sharing options...
shawdown Posted July 31, 2018 Share Posted July 31, 2018 Na versão mais recente do unigui, o comando SetFocus funciona no onCreate. onCreate of the form. Quote Link to comment Share on other sites More sharing options...
SayeyeZohor Posted March 6, 2019 Share Posted March 6, 2019 hi how focus of unicheckbox to uniedit? Quote Link to comment Share on other sites More sharing options...
SayeyeZohor Posted March 6, 2019 Share Posted March 6, 2019 hi how focus of unicheckbox to uniedit? Quote Link to comment Share on other sites More sharing options...
rtalmeida Posted March 6, 2019 Share Posted March 6, 2019 When I needed it, I was told to do so: UniFormAfterShow UniSession.AddJS('setTimeout(function(){'+UniEdit2.JSName +'.focus()}, 100)'); 1 Quote Link to comment Share on other sites More sharing options...
Pep Posted March 7, 2019 Share Posted March 7, 2019 9 hours ago, rtalmeida said: When I needed it, I was told to do so: UniFormAfterShow UniSession.AddJS('setTimeout(function(){'+UniEdit2.JSName +'.focus()}, 100)'); rtalmeida, thanks a lot for this tip. For Frames I tested UniFrameReady an also works! Quote Link to comment Share on other sites More sharing options...
M.Ammar Posted March 7, 2019 Share Posted March 7, 2019 hi i use this, procedure TfraEntr.UniFrameReady(Sender: TObject); begin UniDBEdit.JSInterface.JSCall('focus', []); end; regards Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.