Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » update table viewer
update table viewer [message #876208] Thu, 24 May 2012 06:21 Go to next message
Timothy Vogel is currently offline Timothy VogelFriend
Messages: 82
Registered: July 2009
Member
I have a table viewer that is not displaying updates and need a pointer to what I'm overlooking. I thought the right process was to set the Input of the table viewer and refresh it. This works to display the original data but does not display the updated model data. Here is some pseudo code showing what I'm doing.

In constructor for class derived from SectionPart {
  create table viewer with appropriate columns
  tableViewer.setContentProvider(new ArrayContentProvider());
}

@Override
public refresh() {
  tableViewer.setInput(myModel.getContacts());
  tableViewer.refresh();
}

private editRecord() {
  display dialog box for editing
  if(user pressed OK) {
    updateMyModel();
    this.markDirty();
    this.refresh();
  }
}


Thanks for taking the time to help!!
Re: update table viewer [message #876230 is a reply to message #876208] Thu, 24 May 2012 07:36 Go to previous message
Thorsten Schlathölter is currently offline Thorsten SchlathölterFriend
Messages: 312
Registered: February 2012
Location: Düsseldorf
Senior Member
If you set the input you don't even need to refresh the viewer and
if your editing process works on the current model of the viewer a
refresh would be sufficient.

The pseudo code looks correct to me. Make sure that refresh is really called.
If you don't see any changes in the viewer I would suspect that the model did
not really change. In that case Try setting an empty model to see if that is
reflected.

Regards,
Thorsten
Previous Topic:Zoom Image
Next Topic:Editor focusLost not getting fired when wizard appears
Goto Forum:
  


Current Time: Fri Apr 19 01:34:38 GMT 2024

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

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

Back to the top