Skip to main content

ComboBoxBinding not populating bindinded JComboBox selection list

No replies

Using the code listed below I have created a JComboBox and a ComboBoxBinding for it.
I know that I am getting 3 rows back from the employeeTable load.
I know that the current item has been set for the JComboBox is set because I can see it.

I know that selection list is not being populated because the I can see that list is empty and

System.out.println("Items in dispReciever JComboBox: " + dispReciever.getItemCount());

returns 0.

Is the implementation of ComboBoxBinding currently completed and therefore should be working or is this just a bug.

private static DataSet dispatchDS;
private static DataTable employeeTable;
private static SQLDataProvider employeeProvider;
private JComboBox dispDispatcher;
private ComboBoxBinding dispRecieverBinding;

//Create Database connection
conn = new JDBCDataConnection("com.mysql.jdbc.Driver",

dispatchDS = new DataSet();
employeeTable = dispatchDS.createTable("employee");

//Set Provider connection

dispReciever = new JComboBox();

employeeDataModel = new DataModelAdapter(dispatchDS.getTable("employee").getSelector("current"));

dispRecieverBinding = new ComboBoxBinding(dispReciever, employeeDataModel, "empFirstName");

//Create new row in datatable
System.out.println("Creating new dispatch record......");

System.out.println("Employee TAble Num Rows: " + employeeTable.getRows().size());

DataSelector employeeSelector = dispatchDS.getTable("employee").getSelector("current");
employeeSelector.setRowIndices(new int[] {0});

System.out.println("Items in dispReciever JComboBox: " + dispReciever.getItemCount());