craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > CellEditor/Renderer Post New Topic   Post A Reply
JComboBox problem printer friendly version
next newest post | next oldest post
Author Messages
mexican
Private First Class

Gender: Male
Location: Mexico city
Registered: Sep 2008
Status: Offline
Posts: 12

Click here to see the profile for mexican Send email to mexican Send private message to mexican Find more posts by mexican Edit or delete this message Reply w/Quote
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

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
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

Click here to see the profile for mexican Send email to mexican Send private message to mexican Find more posts by mexican Edit or delete this message Reply w/Quote
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

Click here to see the profile for mexican Send email to mexican Send private message to mexican Find more posts by mexican Edit or delete this message Reply w/Quote
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

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
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

Click here to see the profile for mexican Send email to mexican Send private message to mexican Find more posts by mexican Edit or delete this message Reply w/Quote
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

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
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.
Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios