Limit LookupCombo Elements

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

jascha
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: 14.10.2005, 14:31
Location: Füssen
Contact:

Limit LookupCombo Elements

Postby jascha » 14.07.2006, 10:22

Hallo,
I have a DBGrid with 2 Lookup fields in it. I now want to limit the selectable entrys in the second one depending on the value in the first one.

For better understanding parts of my db:

Master Table:
CREATE TABLE seminare
(
seminar_id serial NOT NULL,
kurs_id int2,
kurs_teile_id int4,
)

Lookup Tables:
CREATE TABLE kurs
(
kurs_id serial NOT NULL,
name varchar(255),
)


CREATE TABLE kurs_teile
(
kurs_teile_id serial NOT NULL,
kurs_id int4,
name varchar(255),
)

in english
kurs=seminar
kurs_teile=seminar_parts

I made seminare to the mastersource of kurs_teile an connected kurs_id. This works perfekt, I only can get the kurs_teile for the selected kurs. But there are problems in displaying the list. Often the kurs_teile lookup field is empty. If I remove the mastersource from kurs_teile it works but then I have to whole list which I dont want.

So
1. Can I somehow fix the displaying of the list?
or
2. Is there an other method to limit the entrys in a Combo box?

Thank You
Jascha

DB: PostgreSQL 8.0
ZeosLib from svn
Delphi 7

bangfauzan
Senior Boarder
Senior Boarder
Posts: 50
Joined: 31.08.2006, 10:41
Contact:

Postby bangfauzan » 28.09.2009, 16:54

I have the same problem.
MASTER table: (notran, custno, kontak, .....)
KONTAK table (id, nama, ....)
DsMaster.DataSet := MASTER;
KONTAK.MasterSource := dsMaster;
KONTAK.MasterFields:='custno';
KONTAK.LinkedFields:='id';

MASTER contains lookupfield calls luKontak
luKontak.LookupDataset:=KONTAK;
luKontak.KeyFields:='kontak';
luKontak.LookupKeyFields:='id';
luKontak.LookupResultFIeld :='nama';

if I set KONTAK.MasterSource to be Nil, everything work OK, but unwanted list also showed.
but if I set KONTAK.MasterSource to DsMaster (referencing each other), lookupfield will be empty every I call CANCEL method to the MASTER table.
lookupfield works OK before CANCEL method is called;

any idea????

many thanks.


Return to “6.5.1 (alpha) - 6.6.x (beta)”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest