bbm Posted July 31, 2018 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
belo Posted July 31, 2018 Posted July 31, 2018 procedure TUniFrame1.UniFrameCreate(Sender: TObject); begin UniEdit1.SetFocus; end; Quote
bbm Posted July 31, 2018 Author 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
bbm Posted July 31, 2018 Author 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
shawdown Posted July 31, 2018 Posted July 31, 2018 Na versão mais recente do unigui, o comando SetFocus funciona no onCreate. onCreate of the form. Quote
rtalmeida Posted March 6, 2019 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
Pep Posted March 7, 2019 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
M.Ammar Posted March 7, 2019 Posted March 7, 2019 hi i use this, procedure TfraEntr.UniFrameReady(Sender: TObject); begin UniDBEdit.JSInterface.JSCall('focus', []); end; regards Quote
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.