Author |
Messages |
mexican
Private First Class
Gender: Male
Location: Mexico city
Registered: Sep 2008
Status: Offline
Posts: 12
|
Posted Wednesday, September 17, 2008 @ 21:08:46
Is there a way to create a JComboBox similar to the drop down selects in html? for example in html you I use <select something>
<option value=real value>Just a name</option>
</select>
I need to fill a JComboBox with two values retrieved from a database table because I most display it in a DBTable, since the value is a foreign key, it's just a serial number without meaning to the user, that's why I need to show a name(for employee) in the JComboBox but the real value that must be inserted in the table is the serial number, similar to html logic.
any idea thank you! ~0
|
Admin
Board Owner
Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9
|
Posted Wednesday, September 17, 2008 @ 21:55:03
You can bind the combo box values, refer
Column.setBoundSql
http://quicktable.org/doc/quick/dbtable/Column.html#setBoundSql(java.lang.String)
|
mexican
Private First Class
Gender: Male
Location: Mexico city
Registered: Sep 2008
Status: Offline
Posts: 12
|
Posted Thursday, September 18, 2008 @ 17:07:50
It worked great! many thanks! :)
|
mexican
Private First Class
Gender: Male
Location: Mexico city
Registered: Sep 2008
Status: Offline
Posts: 12
|
Posted Thursday, September 25, 2008 @ 21:02:00
I realize than when I insert a value in a table, a JCombobox(using setBoundSql in another table) is supposed to show that value, but it doesnīt until I quit the application and start it again When I look in the database (db2) itīs inserted correctly How can I correct this?
|
Admin
Board Owner
Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9
|
Posted Friday, September 26, 2008 @ 09:10:59
use Column.refreshBoundCombo()
Please read api before posting questions.
|
mexican
Private First Class
Gender: Male
Location: Mexico city
Registered: Sep 2008
Status: Offline
Posts: 12
|
Posted Thursday, October 9, 2008 @ 09:26:07
Is it possible to have two JComboBoxes in one cell? I tried the example in CustomerOrderDemo (FileCell CellComponent) but the button(for the JFileChooser) is shown very small and is not clearly visible. thanks admin. :D
|
Admin
Board Owner
Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9
|
Posted Monday, October 13, 2008 @ 08:17:43
You should be able to place more than one combobox in a cell. You need to implement your own version of CellComponent similar to File cell. The size of the combobox will be purely determined by the layout you use in your cellcomponent.
|