I'm seeing a problem with a combobox in a datagrid that I simply have
not been able to solve.
The setup:
Consider a datagrid where one of the columns has a combobox
itemrenderer/editor in each row with choices A,B,C,or D. Outside of
the datagrid is a Save button, along with another combobox exactly
like the others, but choosing an option here forces all other
comboboxes inside the datagrid to change to it. So selecting B in the
outside combo makes all combos in the datagrid go to B.
As far as the code structure goes, the itemrenderer is drop-in, and
the root component is an hbox, with the combobox inside it. This is
to that I could align it to the right of the cell.
The structure is like this:
<DataGridColumn>
<itemrenderer>
<hbox>
<combobox>
To get the grid combos to change, I bound their selectedIndex to the
selectedIndex of the outerDocument.combo
Everything works fine if choosing an option within the grid. But
when using the outside combobox to change the others, the grid combo
boxes are NOT updating their dataprovider. But, oddly, I have
observed that if I change the outer combo setting, then click anywhere
in the grid FIRST, and then click my Save button, it works.
I thought that perhaps I needed to dispatch a CHANGE or CLICK event,
so I altered the combo bindings to create a bindsetter instead that
does the same thing plus dispatch an event. I have tried dispatching
a variety of events and nothing works.
How do I get the grid combos to update the datagrid dataprovider when
using the outside combo???