I am trying to use data binding to show a single element in a collection. I have looked at the phone book application, but trying to apply it to my particular setup has proven frustrating. I feel I am missing one particular bit of understanding, and hopefully someone can nudge me in the right direction.
I have a datagrid (Nebula control). The grid shows rows from a ResultSet, using a content provider that returns the data as a string array. This all works.
The purpose of this application to is to let the user map and change field types. The data being shown is for information purposes, so the user can see what's in each column of the table. What matters is which *column* is being selected, though the user can navigate cell-by-cell. So the grid's selection will return a cell, but what I care about is the column the cell is in.
In the header of each cell is a custom control which allows the user to set specific field data, and more data is displayed on a panel above the grid. The data model that feeds both the header control in the grid column and the detailed data display on the panel is called FieldColumnInfo, and I have a vector of those, with one for each column.
When the user moves from one column to the next, the panel should change to reflect the new column's data; when the user edits the data, either in the panel or the column header, the underlying model needs to be updated.
I tried creating a wrapper class for the list of field columns, and made it a SelectionProvider, and tried to bind the fields to the column selected (any time the user clicked on the grid, I would set the selection in the wrapper class to the proper index), but this did not work, or, at least, I set something up wrong.
Any help is appreciated. Thank you. This has been frustrating me for several days, and I know it should be much easier than it seems.