Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Combo and database.(Get ID row from Combo selected item.)
Combo and database. [message #871023] Thu, 10 May 2012 10:41 Go to next message
Eclipse UserFriend
Morning !!!

I'm using DTO and DAO.
I have a table with two columns: ID and names
My Combo contains names from that table.
I want to get the ID from items on my Combo when I pick one.

Thanks, I'm a beginner on SWT.

UPDATE
Hey people, I resolve it. Just put the ID inside your Combo besides NAME and it works.

[Updated on: Wed, 23 May 2012 10:46] by Moderator

Re: Combo and database. [message #873561 is a reply to message #871023] Fri, 18 May 2012 10:31 Go to previous message
Eclipse UserFriend
If you want to keep the ids and names somewhat close together then you
could use Combo.setData(name, id) to store them and Combo.getData(name)
to look up an id based on a name.

I'd think more typically you would have these associations available
from some kind of model object, which would provide the id associated
with a name without any involvement from swt.

Grant


On 5/10/2012 10:41 AM, Aberforth Dumbledore wrote:
> Morning !!!
>
> I'm using DTO and DAO.
> I have a table with two columns: ID and names
> My Combo contains names from that table.
> I want to get the ID from items on my Combo when I pick one.
>
> Thanks, I'm a beginner on SWT.
Previous Topic:SWT COM on X64
Next Topic:File Dialog opens default path all the time
Goto Forum:
  


Current Time: Sun Aug 31 22:44:32 EDT 2025

Powered by FUDForum. Page generated in 0.05898 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top