dkeene Posted September 7, 2020 Share Posted September 7, 2020 Hello I need a strategy or maybe I am doing something wrong. I have a dropdown and user types a few key letters in the edit part of the dropdown, and after a CheckChangeDelay of 4000 (for example), I have a function call within thecombobox.OnChange to return a result set based on the edit box which works well, and then dropdown the combobox for user to select from the results. Problem is that although I clear the combobox items, they are still in the dropdown list and the dropdown does not reflect the changes that I made. procedure TfmTableEdit.UniComboBoxChange(Sender: TObject); var MySQL: String; begin MySQL:=// example "select name from table where name like '%keyword%' limit 7" //Clear ComboBox Items. TUniDBCombobox(Sender).Items.Clear; TUniDBCombobox(Sender).Refresh; uniMainModule.MPopulateviaSQL(MySQL, TUniComboBox(Sender), 100); //populates this dbcombobox.items with result set from MySQL. //force dropdown to open (Sender as TUniDBComboBox).JSInterface.JSCallDefer('expand', [], 200); end; Any thoughts? Thanks Doug Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted September 9, 2020 Share Posted September 9, 2020 On 9/7/2020 at 10:28 AM, dkeene said: Hello I need a strategy or maybe I am doing something wrong. I have a dropdown and user types a few key letters in the edit part of the dropdown, and after a CheckChangeDelay of 4000 (for example), I have a function call within thecombobox.OnChange to return a result set based on the edit box which works well, and then dropdown the combobox for user to select from the results. Problem is that although I clear the combobox items, they are still in the dropdown list and the dropdown does not reflect the changes that I made. procedure TfmTableEdit.UniComboBoxChange(Sender: TObject); var MySQL: String; begin MySQL:=// example "select name from table where name like '%keyword%' limit 7" //Clear ComboBox Items. TUniDBCombobox(Sender).Items.Clear; TUniDBCombobox(Sender).Refresh; uniMainModule.MPopulateviaSQL(MySQL, TUniComboBox(Sender), 100); //populates this dbcombobox.items with result set from MySQL. //force dropdown to open (Sender as TUniDBComboBox).JSInterface.JSCallDefer('expand', [], 200); end; Any thoughts? Thanks Doug Hi, Please set RemoteQuery:=True and use OnRemoteQuery event instead of OnChange event. You can also check "ComboBox Remote Data" demo. It is for DBLookupCombobox but it is the same idea. C:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Desktop\ComboBox Remote Data Quote Link to comment Share on other sites More sharing options...
dkeene Posted September 11, 2020 Author Share Posted September 11, 2020 Thank you Hayri I am trying to make this work. 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.