![]() |
How do you fill a TIWDBLookupList with ListSource data? - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: English (https://www.atozed.com/forums/forum-16.html) +----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html) +----- Thread: How do you fill a TIWDBLookupList with ListSource data? (/thread-27.html) |
How do you fill a TIWDBLookupList with ListSource data? - cogniscaena - 03-20-2018 ListSource | ListField data not showing in TIWDBLookupList. How do you get the data to show? RE: How do you fill a TIWDBLookupList with ListSource data? - kudzu - 03-21-2018 You will need to be more specific. Generally it mimics the standard DBCombos, but you need to make sure it has an active data source etc. RE: How do you fill a TIWDBLookupList with ListSource data? - Alexandre Machado - 03-21-2018 (03-20-2018, 10:14 PM)cogniscaena Wrote: ListSource | ListField data not showing in TIWDBLookupList. How do you get the data to show? It basically works just like a std VCL TDBLookupListBox. Connect a TDataSource to it through its ListSource property. Set KeyField and ListField properties. You are done. It will display all records in your TDataSource. To use this TIWDBLookupList to update another dataset you must connect it to a second TDataSource through its DataSource property. Also set its DataField property. DataSource's DataField will be updated using KeyField value of ListSource RE: How do you fill a TIWDBLookupList with ListSource data? - KristofVR - 01-12-2021 "It basically works just like a std VCL TDBLookupListBox. " Not entirely. There seems to be a difference with the VCL component, and that is that the cursor does not change while clicking an object in the list. For example, this code always returns the result of the last record. In VCL this code gives me the value of column1 for the line that is clicked on. procedure TIWForm1.IWDBLookupListBox1AsyncClick(Sender: TObject; EventParams: TStringList); begin iwedit1.Text:=clientdataset1.FieldByName('Column1').asString ; end; RE: How do you fill a TIWDBLookupList with ListSource data? - KristofVR - 01-14-2021 SOLVED! By adding this line in the asyncclick method: clientdataset1.RecNo:= iwdblookuplistbox1.ItemIndex; RE: How do you fill a TIWDBLookupList with ListSource data? - Alexandre Machado - 01-21-2021 (01-12-2021, 11:58 AM)KristofVR Wrote: "It basically works just like a std VCL TDBLookupListBox. " That's now how you should do it. VCL and Web applications *are* different and behave differently too. You need to inspect the value of the IWDBLookupListBox, not the value of the lookup ClientDataSet. Try to do IwEdit1.Text := IWDBLookupListBox1.SelectedValue; // or SelectedText |