Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Refreshing a KTableCellEditorCombo in a KTable
Refreshing a KTableCellEditorCombo in a KTable [message #460467] Mon, 29 August 2005 14:31 Go to next message
J. Shanonn is currently offline J. ShanonnFriend
Messages: 12
Registered: July 2009
Junior Member
Hello,
I've got a problem with in my KTable that has a column that renders a
ComboBox of items. The issue I'm finding is that when a new row is added
to the table, the table does not refresh properly when a selection in made
in the column with the ComboBox. Initially the correct item appears
selected, but when I traverse to another cell the combo returns to the
default selection. I should say too that the table content does get
updated properly with the option selected by the user, its just that the
table does not get refreshed to display the changes in the underlying
content. Can anyone offer some advice?

Thanks in advance,
JS
Re: Refreshing a KTableCellEditorCombo in a KTable [message #460502 is a reply to message #460467] Tue, 30 August 2005 11:38 Go to previous messageGo to next message
Lorenz Maierhofer is currently offline Lorenz MaierhoferFriend
Messages: 88
Registered: July 2009
Member
Hi,

Not sure if I understand correctly:
You have a KTableModel that shrinks or grows the number of rows?
Since the KTable cannot know of such an event, be sure to do a
(selective) redraw on the KTable. Otherwise it might happen that when
redrawing single cells, values from the inserted row appear in another row.

About the Combo editor:
The editor is designed to write back the selected value when it is
closed. See the close(boolean) method. Thus, befor the editor is closed,
the model has the old value.



JS wrote:
> Hello,
> I've got a problem with in my KTable that has a column that renders a
> ComboBox of items. The issue I'm finding is that when a new row is
> added to the table, the table does not refresh properly when a selection
> in made in the column with the ComboBox. Initially the correct item
> appears selected, but when I traverse to another cell the combo returns
> to the default selection. I should say too that the table content does
> get updated properly with the option selected by the user, its just that
> the table does not get refreshed to display the changes in the
> underlying content. Can anyone offer some advice?
>
> Thanks in advance,
> JS
>
Re: Refreshing a KTableCellEditorCombo in a KTable [message #460508 is a reply to message #460502] Tue, 30 August 2005 13:45 Go to previous messageGo to next message
J. Shanonn is currently offline J. ShanonnFriend
Messages: 12
Registered: July 2009
Junior Member
Thanks for your reply Lorenz. Yes, my KTable is designed to allow the
user to add and/or remove rows from the table. I'll try the selective
redraw and investigate using the close(boolean) method. I'll let you know
how I make out

JS

Lorenz Maierhofer wrote:

> Hi,

> Not sure if I understand correctly:
> You have a KTableModel that shrinks or grows the number of rows?
> Since the KTable cannot know of such an event, be sure to do a
> (selective) redraw on the KTable. Otherwise it might happen that when
> redrawing single cells, values from the inserted row appear in another row.

> About the Combo editor:
> The editor is designed to write back the selected value when it is
> closed. See the close(boolean) method. Thus, befor the editor is closed,
> the model has the old value.



> JS wrote:
>> Hello,
>> I've got a problem with in my KTable that has a column that renders a
>> ComboBox of items. The issue I'm finding is that when a new row is
>> added to the table, the table does not refresh properly when a selection
>> in made in the column with the ComboBox. Initially the correct item
>> appears selected, but when I traverse to another cell the combo returns
>> to the default selection. I should say too that the table content does
>> get updated properly with the option selected by the user, its just that
>> the table does not get refreshed to display the changes in the
>> underlying content. Can anyone offer some advice?
>>
>> Thanks in advance,
>> JS
>>
Re: Refreshing a KTableCellEditorCombo in a KTable [message #460512 is a reply to message #460508] Tue, 30 August 2005 15:24 Go to previous message
Lorenz Maierhofer is currently offline Lorenz MaierhoferFriend
Messages: 88
Registered: July 2009
Member
Hi,

Just to make myself clear:
If the editor is opened, it always gets fresh data from the model -
which might not be the one that is currently drawn in the tablemodel.

The close()-method of the celleditor closes the editor, so you might
want to update the model information manually when you change from one
option to the next in the editors combo. Do that by subclassing the
editor and invoke KTableModel.setContent().
However, I have never really seen a case where it makes sense to save
every temporarily chosen editor value to the model. It is expected
behaviour that the edited data becomes valid after the editor is closed
normally, or is discarded when the edit action is aborted (for example
with the ESC key).

regards,


JS wrote:
> Thanks for your reply Lorenz. Yes, my KTable is designed to allow the
> user to add and/or remove rows from the table. I'll try the selective
> redraw and investigate using the close(boolean) method. I'll let you
> know how I make out
>
> JS
>
> Lorenz Maierhofer wrote:
>
>> Hi,
>
>
>> Not sure if I understand correctly:
>> You have a KTableModel that shrinks or grows the number of rows?
>> Since the KTable cannot know of such an event, be sure to do a
>> (selective) redraw on the KTable. Otherwise it might happen that when
>> redrawing single cells, values from the inserted row appear in another
>> row.
>
>
>> About the Combo editor:
>> The editor is designed to write back the selected value when it is
>> closed. See the close(boolean) method. Thus, befor the editor is
>> closed, the model has the old value.
>
>
>
>
>> JS wrote:
>>
>>> Hello,
>>> I've got a problem with in my KTable that has a column that renders a
>>> ComboBox of items. The issue I'm finding is that when a new row is
>>> added to the table, the table does not refresh properly when a
>>> selection in made in the column with the ComboBox. Initially the
>>> correct item appears selected, but when I traverse to another cell
>>> the combo returns to the default selection. I should say too that
>>> the table content does get updated properly with the option selected
>>> by the user, its just that the table does not get refreshed to
>>> display the changes in the underlying content. Can anyone offer some
>>> advice?
>>>
>>> Thanks in advance,
>>> JS
>>>
>
Previous Topic:Not able to see double-byte in StyledText widget
Next Topic:Can 'Tree' set the image?
Goto Forum:
  


Current Time: Mon Apr 19 08:16:45 GMT 2021

Powered by FUDForum. Page generated in 0.02428 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top