Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Hidden Id for TableItem
Hidden Id for TableItem [message #1067049] Fri, 05 July 2013 15:16 Go to next message
birt user is currently offline birt userFriend
Messages: 26
Registered: January 2013
Junior Member
I have an org.eclipse.swt.widgets.TableItem object which needs to have both a display name and a hidden id. When the user clicks on the tableItem, my code will call a database which uses the hidden id.

I don't see anywhere on the API for TableItem to store a hidden id value. The setText method controls the user displayed value. What is the best practice for storing a hidden id for each element in a table?

Thanks!
Re: Hidden Id for TableItem [message #1067102 is a reply to message #1067049] Fri, 05 July 2013 20:55 Go to previous message
birt user is currently offline birt userFriend
Messages: 26
Registered: January 2013
Junior Member
I did some more research and I found two workarounds:

1. The TableItem inherits from Widget and Widget has a getData and setData method which sets/gets a java Object. I put my id in this data field since it was unused.

2. I also read some forum posts where users added a column with width 0 that contained the ids and read the ids out of this column.
Previous Topic:Create a rectangle of selection
Next Topic:A double click on a org.eclipse.swt.custom.TreeCursor isn't detected
Goto Forum:
  


Current Time: Mon Dec 22 02:51:44 GMT 2014

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

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