Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 14:41 Go to next message
Aberforth Dumbledore is currently offline Aberforth DumbledoreFriend
Messages: 17
Registered: April 2012
Location: A planet called Earth
Junior Member
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 14:46]

Report message to a moderator

Re: Combo and database. [message #873561 is a reply to message #871023] Fri, 18 May 2012 14:31 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
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: Thu Apr 25 01:49:40 GMT 2024

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

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

Back to the top