RxDBConvoLookup question lazarus / 16-Databases ---------------------------------------------------------------------- daveinhull · 2019-02-06 19:15 Hi I have an RxDBCombiLookup control connected to a field in a grid. When I enter that field the lookup gets focus with the value in field and I can select another value from the dropdown and it gets put into the field, all that works as expected. However if the value of the field is null,  the combo gets null ok. I have trapped not found entered values and opened a form to get all the other data I need and if confirmed I can add the new value to the dropdown and then to the associated field, and that works. But if I want to cancel the new value and put the dropdown back to the original value of null, it doesn't like me trying to set the .value field in the dropdown to null. It says it cant convert a null to a string, but the field is actually declared as a variant, and it does pick up nulls from the underlying grid field if it is that value. Is there anyway to revert an RxDBComboLookup back to its entered value? Thanks in advance Dave ---------------------------------------------------------------------- daveinhull · 2019-02-10 11:19 Hi Can anyone help please, I've tried everything and exhausted my Google searching. I have the following code. The problem lies with the Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i KeyValue := OldKeyValue The general operation is, when the user enters some text which isn't in the dropdown and the user wants to add it, it is detected and a form opens to get other information. If information is entered then all is OK, but if the user presses Cancel I want to put the dropdown back to the original value. This is the problem, if I hard code it to a value (say 3) then it works, but if I try to set it to the OldKeyValue (which does contains the right value) it just ignores it and the dropdown goes back to somewhere in the list related to the text that was entered (but obviously not the exact text as this wasn't in the list) OldKeyVaue is declared as a Variant as is KeyValue in the TRxDBLookupCombo. The exampl ebelow shows both setting because I thought it might work if I force it to a 3 then to the real value I want, but it just stays at 3 even though OldKeyValue is 22. PS OldKeyValue is set when it enteres the DropDown. Anyone with any thoughts, please Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.RxDBLookupComboClosePopup(Sender: TObject; SearchResult: boolean);begin  with TRxDBLookupCombo(Sender) do  if (Caption <> '') and (LookupSource.DataSet.lookup(LookupDisplay,Caption,'ID') = Null) then    if Application.MessageBox (PChar('Please confirm to add ' + Caption), PChar('New ' + DataField), MB_ICONQUESTION or MB_YESNO) = IDYES then    case name of      'RxDBLookupCombo1', 'RxDBLookupCombo5':      begin        Form2.Edit3.Caption := Caption;        AddAirport (Sender);        KeyValue := 3;        KeyValue := OldKeyValue;      end; ---------------------------------------------------------------------- madref · 2019-02-11 11:54 Quote from: daveinhull on February 10, 2019, 12:19:49 pmThe general operation is, when the user enters some text which isn't in the dropdown and the user wants to add it, it is detected and a form opens to get other information. If information is entered then all is OK, but if the user presses Cancel I want to put the dropdown back to the original value. I presume that the data from the combobox comes from a database. If user pressed cancel just refill the combobox with your original database query and all is restored ---------------------------------------------------------------------- daveinhull · 2019-02-11 17:15 Hi madref, Thanks for the feedback. It is an RxDBLookupCombo with an attached datasource back to the main DB. I have tried everything including refreshing the dataset, setting the LookupCombo index, value, caption to the value I need, but as I mentioned, if the value is the same as the original one it just ignores it, but if I force it to a different item in the dropdown it does it. I'm almost at the point of just switching of that feature! Dave ---------------------------------------------------------------------- balazsszekely · 2019-02-11 19:09 I never worked with Rx component, but what is that "UnfindedValue" property? Maybe setting to rxufLastSuccessful or rxufOriginal helps? Or maybe you found a bug and you should report it(https://sourceforge.net/p/lazarus-ccr/bugs/). ---------------------------------------------------------------------- daveinhull · 2019-02-11 19:22 Hi GetMem, Thanks for the reply, already tried all those combinations  Beginning to think it must be a bug, but do you think anyone is still maintaining this package? Dave ---------------------------------------------------------------------- balazsszekely · 2019-02-11 19:25 Quote from: daveinhull on February 11, 2019, 08:22:04 pmHi GetMem, Thanks for the reply, already tried all those combinations  Beginning to think it must be a bug, but do you think anyone is still maintaining this package? Dave AFAIK user alexs75(http://forum.lazarus.freepascal.org/index.php?actio n=profile;u=39260) maintains package rx. Please PM him. ---------------------------------------------------------------------- daveinhull · 2019-02-11 19:41 Thanks GetMem