Recent

Author Topic: TDBComboBox and TDBListBox not work  (Read 20115 times)

Dibo

  • Hero Member
  • *****
  • Posts: 1048
TDBComboBox and TDBListBox not work
« on: March 16, 2007, 07:20:33 pm »
Hi. First, sorry for my English. I'm from Poland :)

So. I try to use TDBComboBox like TDBLookupComboBox in Delphi to view all records from table in dropdown list. I do this identically like in Delphi (TDBComboBox -> DataSource -> Query/Table). I select some data from table. In Query are 7 records, but in TDBCombobox is one and only in Edit field as text. Dropdown list is empty. TDBListBox is empty too. DBGrid load all records and work corectly. I can write class inherited from TDBComboBox and in loop add all records but why wasting time, maybe it's little defect and simply to repair.

P.S. I tryed with ZEOS components and Lazarus TSQLQuery.

Greetings

andi_an_die_andern

  • Newbie
  • Posts: 2
RE: TDBComboBox and TDBListBox not work
« Reply #1 on: October 29, 2008, 09:37:22 am »
Hi all,

I'm a new with Lazarus and I want to create an application for windows xp and WinCE, that will use a (SDF) database for managing data about Citadell models.

So far, I worked through some tutorials and the framework for this application is working (very good tutorials and easy to use IDE).
Now, I want to use a TDBCombobox to select an item within the database. With this selection i want to show additional information e.g. a picture. The link to the picture is stored within the dataset

The Table looks like:

1. Column=> Index => Integer
2. Column=> Name of the model => String e.g. "Captain"
3. Column=> relative link to picture => String e.g. "./Bilder/Captain.jpg'

The problem I have is described briefly above. When I connect the Field "DBComboBox1.DataField" to the 2.Column (DBComboBox1.DataSource is connected to the Table) I would expect the entire entries of the column for selection within the combobox. But, only the very first entry is visibel and when i open the Combobox the list has no more entries.

Is this correct, or do I have to add the items to the list manually?

Thanks

tatamata

  • Hero Member
  • *****
  • Posts: 736
    • ZMSQL - SQL enhanced in-memory database
TDBComboBox and TDBListBox not work
« Reply #2 on: October 30, 2008, 11:43:56 am »
Hi, guys!

I think you have missunderstood DBCombobox concept.
It is not to show all values from the DataSource in its list. On the contrary, it shows only current record from the DataSource, but enables to write a value from the provisional predefined list (property Items) into the current record of the DataSource (properties DataSource, DataField).
You have to provide values for this list, stored in the property Items, for yourself...

DBCombobox.Items.Add('Customer 1');
DBCombobox.Items.Add('Customer 2');
...

andi_an_die_andern

  • Newbie
  • Posts: 2
TDBComboBox and TDBListBox not work
« Reply #3 on: October 31, 2008, 11:13:30 am »
Thanks for your reply tatamata,

I also posted my question within the german lazarus protal and they told me, that this is done wth the DBLookUpComboBox (occasionally this is not implemented in lazarus jet :cry: )

http://www.lazarusforum.de/viewtopic.php?f=17&t=2163

Thanks again

DougNettleton

  • Jr. Member
  • **
  • Posts: 84
TDBComboBox and TDBListBox not work
« Reply #4 on: October 31, 2008, 03:48:34 pm »
I suggest you download and install the package rxnew from

https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr

The RxDBAware components tab includes a RxDBLookupCombo component that I've used successfully.

HTH,

Doug

jtiedeman

  • New member
  • *
  • Posts: 8
Re: TDBComboBox and TDBListBox not work
« Reply #5 on: March 17, 2009, 09:23:01 pm »
The link Doug gane works, but the download makes a lot of Windows calls, which don't work in Linux.

DougNettleton

  • Jr. Member
  • **
  • Posts: 84
Re: TDBComboBox and TDBListBox not work
« Reply #6 on: March 25, 2009, 04:57:29 pm »
Are you saying that the components in rxnew don't work with linux or that there are other components at:
lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr that are windows specific?

The reason I ask is because the "lazarus wiki page RXFPC says:

> Tested on Linux. Changes to be made:
>
> Canvas.BrushCopy is used. You should replace this with a call to
> Canvas.CopyRect.
> Add Types to the uses in rxdbgrid.pas and rxtoolbar.pas
>
> An updated version will be posted as soon as possible.

I personally have only tried these components with Windows, but it would be good to know that all the components I'm using are platform independent.

Regards,

Doug

alexs75

  • Full Member
  • ***
  • Posts: 106
Re: TDBComboBox and TDBListBox not work
« Reply #7 on: March 26, 2009, 05:56:26 pm »
rxpfc work in linux.
i'm test it's on Fedora7 and Fedora 10

vfclists

  • Hero Member
  • *****
  • Posts: 855
    • HowTos Considered Harmful?
Re: TDBComboBox and TDBListBox not work
« Reply #8 on: April 01, 2009, 04:09:40 am »
I have tried to install rx on the latests lazarus my system and compilation failed with

C:\lazarus\components\rxfpc\rxlookup.pas(464,11) Error: identifier idents no member "KeyDown" 

I am using 0.9.26.2 beta. Is it the right rx components I downloaded?
The files I am using date back to 25/05/2007.

Can they be obtained from a readily archived file?
« Last Edit: April 01, 2009, 04:20:10 am by vfclists »
Lazarus 2.1.0/FPC 3.2.0

DougNettleton

  • Jr. Member
  • **
  • Posts: 84
Re: TDBComboBox and TDBListBox not work
« Reply #9 on: April 01, 2009, 04:02:09 pm »
Hi:

I see you found this thread.  I'm not sure where you downloaded from but the svn version I referred to has rxlookup.pas updated Mar 16, 2009 and the lazarus package file updated Mar 2, 2009.

I installed it under windows last night with Mar 31 lazarus 32 bit snapshot.

I'm running the nightly snapshot from Mar 23 here with it installed.

Version #:0.9.27beta, FPC Version 2.2.5, SVN revision: 19069

Good Luck,

Doug

vfclists

  • Hero Member
  • *****
  • Posts: 855
    • HowTos Considered Harmful?
Re: TDBComboBox and TDBListBox not work
« Reply #10 on: April 01, 2009, 05:30:38 pm »
Can you give me the exact svn commands to download it?

The one I got via the web page may have been outdated.

Thanks

vfclists
Lazarus 2.1.0/FPC 3.2.0

DougNettleton

  • Jr. Member
  • **
  • Posts: 84
Re: TDBComboBox and TDBListBox not work
« Reply #11 on: April 01, 2009, 05:54:44 pm »
Hi again:

I guess it depends on the software, you're using.  Sometime ago I installed TortoiseSVN for windows.

Create a folder - mine's called lazarusSVN.

Right click, choose SVN Checkout

Under URL of repository, enter:

https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr

the Checkout directory will default to the folder you right clicked.

click o.k. button and wait.

Good luck.

 

TinyPortal © 2005-2018