Jump to content

DBLookupComboBox without lookup dataset


Guest

Recommended Posts

Message from: "zilav"

 

Hi Farshad!

 

I have used EhLib components before, and they have a simple and brilliant

TDBComboBox control with dual lists: Items and KeyItems, to create lookup

combos without need of additional dataset. Can you please implement the same

functionality in UniGui? Frankly speaking, half of lookups or even more in

most db apps are static, they never change, but to make them work, we need 1

additional dataset, 1 datasource, 1 table in DB (if not using single global

lookup table), and perform 1 extra query to fill it. It is already a mess to

develop apps with a large number of lookups in traditional desktop VCL with

all those extra db components in datamodules, assignments of listsources,

keyfields and listfields, and a memory hog in runtime too. But in unigui,

where all those datasets are created for each user session, it can become

critical. And I'm not even speaking about startup time for each session

spent creating lookups in datamodules.

 

.

 

  • Upvote 1
Link to comment
Share on other sites

Message from: "Farshad Mohajeri"

 

"zilav" wrote in message

news:PzYMytzzLHA.2720@anaxagvs227...

> Hi Farshad!

>

> I have used EhLib components before, and they have a simple and brilliant

> TDBComboBox control with dual lists: Items and KeyItems, to create lookup

> combos without need of additional dataset. Can you please implement the

> same functionality in UniGui? Frankly speaking, half of lookups or even

> more in most db apps are static, they never change, but to make them work,

> we need 1 additional dataset, 1 datasource, 1 table in DB (if not using

> single global lookup table), and perform 1 extra query to fill it. It is

> already a mess to develop apps with a large number of lookups in

> traditional desktop VCL with all those extra db components in datamodules,

> assignments of listsources, keyfields and listfields, and a memory hog in

> runtime too. But in unigui, where all those datasets are created for each

> user session, it can become critical. And I'm not even speaking about

> startup time for each session spent creating lookups in datamodules.

 

You mean dataset for lookup and target dataset are both same dataset?

 

Say you have a dataset with field named "country". Are you going to fill

the lookup Combo from this field and post changes also to same Field? What

will happen if there are duplicate rows?

 

 

.

 

Link to comment
Share on other sites

Message from: "zilav"

 

>You mean dataset for lookup and target dataset are both same dataset?

 

I mean no dataset for lookup values, the keys are stored in KeyItems

stringlist, Values are in Items stringlist. They both have the same size,

dropdown list is shown using Items list, but real values are taken from

KeyItems. Look here

http://www.ehlib.com/EhLibUsersGuide/UsingEditControls.htm under "Using

TDBComboBoxEh control".

 

 

.

 

Link to comment
Share on other sites

Message from: "Farshad Mohajeri"

 

"zilav" wrote in message

news:lI0nIg3zLHA.2720@anaxagvs227...

> >You mean dataset for lookup and target dataset are both same dataset?

>

> I mean no dataset for lookup values, the keys are stored in KeyItems

> stringlist, Values are in Items stringlist. They both have the same size,

> dropdown list is shown using Items list, but real values are taken from

> KeyItems. Look here

> http://www.ehlib.com/EhLibUsersGuide/UsingEditControls.htm under "Using

> TDBComboBoxEh control".

>

 

Ok. So adding KeyItems property to TBComboBox seems to be enough.

 

Logged #849

 

 

.

 

Link to comment
Share on other sites

Message from: "Junior/RO"

 

zilav escreveu:

 

> I have used EhLib components before, and they have a simple and brilliant TDBComboBox control with dual lists: Items and KeyItems, to create lookup combos without need of additional dataset. Can you please implement the same functionality in UniGui?

 

+1

.

 

  • Upvote 1
Link to comment
Share on other sites

  • 4 years later...

Message from: "zilav"

 

Hi Farshad!

 

I have used EhLib components before, and they have a simple and brilliant

TDBComboBox control with dual lists: Items and KeyItems, to create lookup

combos without need of additional dataset. Can you please implement the same

functionality in UniGui? Frankly speaking, half of lookups or even more in

most db apps are static, they never change, but to make them work, we need 1

additional dataset, 1 datasource, 1 table in DB (if not using single global

lookup table), and perform 1 extra query to fill it. It is already a mess to

develop apps with a large number of lookups in traditional desktop VCL with

all those extra db components in datamodules, assignments of listsources,

keyfields and listfields, and a memory hog in runtime too. But in unigui,

where all those datasets are created for each user session, it can become

critical. And I'm not even speaking about startup time for each session

spent creating lookups in datamodules.

 

.

 

Was developed a component with this feature ?

 

regards

Link to comment
Share on other sites

Agree - and also quite often you need to be able to pick a value with its key,

from a single control - without using a grid -and then a dbcombobox or dblistbox

with a keyfield would do the trick.

 

At the same time - if you make this, Farshad - why not also make a

non-db version where you can store an integer value for each item,

which could then take a key value.

  • Upvote 1
Link to comment
Share on other sites

+1. This would be very useful. Until now, I've been using memory table and dblookupcombobox to achieve this. Using just combobox with key/value pairs would be lot easier and also code would be more clean because in that case, there would be no need to initialize lookup memory table and other things.

  • Upvote 2
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...