Kast2k Posted April 23, 2020 Share Posted April 23, 2020 Hello! There are AdoQuery (aq), Datasource(ds) and DbLookupcombobox (dbc) placed on frame. Also i have a variable integer (varInt=3) for locating data in dbc. aq have 1 parameter and returns 2 fields and configured as ds.Dataset=aq select idStatus, StatusName from tblStatuses where idRelational = :idRelational dbc is configured like Listsource=ds ListField=StatusName KeyField=idStatus After setting the parameter (idRelational=3) aq.Parameters.ParamByName('idRelational').Value=varInt the dbc is refreshed like: procedure TUniMainModule.RefreshDBComboBox(dbc: TUniDBLookupComboBox); begin dbc.BeginUpdate; try try dbc.ListSource.DataSet.Close; dbc.ListSource.DataSet.Open; except on E: Exception do begin PostToLog('RefreshDBComboBox error='+e.Message); end; on E: EOleException do begin PostToLog('RefreshDBComboBox error='+e.Message); end; end; finally dbc.EndUpdate; end; end; After that i'm trying to locate data by this code: function TUniMainModule.LocateData(cb: TUniDBLookupComboBox; const AValue: Variant; const AFieldName: string): Boolean; var b:Boolean; begin b:=False; try if not VarIsNull(AValue) then begin if (VarIsNumeric(AValue) and (AValue<=0)) or (VarIsStr(AValue) and (AValue='')) then begin cb.KeyValue:=null; Exit; end; try b:=cb.ListSource.DataSet.Locate(AFieldName,AValue,[loCaseInsensitive]); if b then cb.KeyValue:=cb.ListSource.DataSet.FieldByName(cb.KeyField).Value else cb.KeyValue:=null; except on E: Exception do begin UniSession.Log(Format('Error LocateData( %s, %s )= %s ',[AFieldName, VarToStr(AValue), e.Message])); end; on E: EOleException do begin UniSession.Log(Format('Error LocateData( %s, %s )= %s ',[AFieldName, VarToStr(AValue), e.Message])); end; end; end else cb.KeyValue:=null; finally Result:=b; end; end; procedure TMyFrame.FindAndShowRowData; begin if UniMainModule.LocateData(dbc,varInt,'idStatus') then begin end end; If i'm opening frame for first time then i can see that LocateData works OK and the only 1 row is showed by component. But if i executing this code (set parameter (3->4), refreshDBCombobox, locatedata) on opened frame again then component dbc shows nothing, but cb.ListSource.DataSet.Locate returns TRUE, needed row exists in list and i can select it manually. What am i doing wrong or is it DBLookupCombobox bug? Unigui 1.90.0.1528. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 23, 2020 Share Posted April 23, 2020 Hello, Sorry, can you make a simple testcase for reproduce? Quote Link to comment Share on other sites More sharing options...
Kast2k Posted April 24, 2020 Author Share Posted April 24, 2020 Test example attached. Also 1 more bug: if You click on button twice+ then data is shown else not. Full working VCL example also included Any ideas? testDBLookComb.zip Quote Link to comment Share on other sites More sharing options...
Kast2k Posted April 24, 2020 Author Share Posted April 24, 2020 Also, AllFeaturesDemo ->Grids ->Filter 2 If you click on Country column filter then You can scroll list only by mouse wheel or clicking on arrows on vertical scrollbar. You can't move scroll with pressed left mouse button. Quote Link to comment Share on other sites More sharing options...
Kast2k Posted April 25, 2020 Author Share Posted April 25, 2020 UniGUI support team, any ideas or comments? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 25, 2020 Share Posted April 25, 2020 Hello, Sorry for the late response. We will let you know. 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.