Subject Re: [IBO] TIB_Lookup List Question
Author Kyle Cordes
> > I am trying to develop a deposit form. On this form I have two
> > TIB_Lookup List Boxes with two buttons in between with arrows on
> > them. I want to be able to populate the box on the left with
records
> > marked for deposit. I want the user to be able to select items in
> > the box and click on the arrow to move them to the box on the right

From: "Jason Wharton" <jwharton@...>
> This is a bit of a difficult thing to do using a client/server
database.
> Each little move of an item causes the refresh of two datasets which
can be
> somewhat inefficient.


I've done that this way:

* Use two TListBoxes.

* Populate them from the database, using the Objects[] to hold a
reference of some kind to their primary key, original status, etc.

* Write code to implement the arrows or drag-and-drop between the list
boxes.

* In some kind of Save button, start a transaction, loop through the
list box items, execute SQL to update the database to reflect their new
status, commit the transaction.

This uses no refreshes or any other server access until they click Save.

I think this could be done in a less code-intensive way, but it worked.
If I had to do it repeatedly, the common code could be factored out. In
particular, a query dataset (one, not two, still no data-aware controls)
could be used behind the scenes in cached updates mode, thus moving the
burden of executing appropriate SQL off of me and on to IBO.

[ Kyle Cordes * kyle@... * www.kylecordes.com ]
[ Developer, Consultant, Trainer: Java, Delphi, ASTA, etc.]
[ Visit the site for articles, links, BDE Alternatives ]
[ Guide, JBuilder Open Tools, and a Delphi Wiki, and more ]