ComboBox value can't be selected [message #1692046] |
Sun, 12 April 2015 20:07 |
Ralf Heydenreich Messages: 235 Registered: July 2009 |
Senior Member |
|
|
Hi all, I've several cells in my table where on of them is a Combobox
selection cell:
//register a combobox editor for values
configRegistry.registerConfigAttribute(
CellConfigAttributes.CELL_PAINTER,
new ComboBoxPainter(),
DisplayMode.NORMAL, MY_CELL_LABEL);
ComboBoxCellEditor myValueCombobox = new
ComboBoxCellEditor(myDAO.findAll());
configRegistry.registerConfigAttribute(
EditConfigAttributes.CELL_EDITOR,
myValueCombobox,
DisplayMode.EDIT, MY_CELL_LABEL);
configRegistry.registerConfigAttribute(
CellConfigAttributes.DISPLAY_CONVERTER,
new PercentageDisplayConverter(),
DisplayMode.NORMAL, MY_CELL_LABEL);
No, the cell is displayed with the correct value (percent in this case)
and a little arrow on the right side. But if I click on this arrow
nothing happens. I can edit all the other (text) cells in this row, but
I can't get out what's missing.
I've used the _447_EditorExample as example for this. Perhaps a layer is
missing or any other configuration? Any help would be appreciated.
Btw, where can I get the extension.builder package of NatTable? The
feature doesn't contain this classes, only the example jar contains them.
Regards,
Ralf.
|
|
|
|
Re: ComboBox value can't be selected [message #1692140 is a reply to message #1692053] |
Mon, 13 April 2015 20:45 |
Ralf Heydenreich Messages: 235 Registered: July 2009 |
Senior Member |
|
|
Am 13.04.2015 um 06:22 schrieb Dirk Fauth:
> Does the combo box open if you click in the text part of the combo? In
> that case it seems there is an issue with your edit configuration
> bindings. Did you modify that?
> The other option is the edit rule configuration. Do you simply enable
> always or on special conditions?
> I could also think of a conversion issue. I'm not sure about your dao
> and your data structure. Does it work if you remove the converter?
> Regarding the builder, we do not support the builder, therefore it is
> not released. If you want to use it you have to check out the sources
> and hope it works with future releases since nobody maintains that
> extension.
Hi Dirk,
thanks for your fast answer. I've checked my configuration and found the
mistake. The (missing) converter was one of the problem. The other one
was that I've missed the DisplayMode configuration for normal mode. Now
it works as expected. Here's the revised version:
//register a combobox editor for values
configRegistry.registerConfigAttribute(
EditConfigAttributes.CELL_EDITABLE_RULE,
IEditableRule.ALWAYS_EDITABLE,
DisplayMode.EDIT, MY_CELL_LABEL);
configRegistry.registerConfigAttribute(
CellConfigAttributes.CELL_PAINTER,
new ComboBoxPainter(),
DisplayMode.NORMAL, MY_CELL_LABEL);
MyValueComboProvider dataProvider = new
MyValueComboProvider(myDAO.findAll());
ComboBoxCellEditor myValueCombobox = new
ComboBoxCellEditor(dataProvider);
myValueCombobox.setFreeEdit(false);
configRegistry.registerConfigAttribute(
EditConfigAttributes.CELL_EDITOR,
myValueCombobox,
DisplayMode.NORMAL, MY_CELL_LABEL);
configRegistry.registerConfigAttribute(
CellConfigAttributes.DISPLAY_CONVERTER,
new MyValueDisplayConverter(),
DisplayMode.NORMAL, MY_CELL_LABEL);
Regards,
Ralf.
|
|
|
Powered by
FUDForum. Page generated in 0.02192 seconds