Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Updating view if model of another view is changed
Updating view if model of another view is changed [message #691570] Fri, 01 July 2011 18:31 Go to next message
AmFreak Missing name is currently offline AmFreak Missing nameFriend
Messages: 25
Registered: June 2011
Junior Member
Hi,

i have a Main-View with a treeViewer that shows projects and persons as branches in those projects. The model of the treeViewer is the table "projects" of a database. The table has a many to many relationship to the another table called "persons". I have a command that opens a second view "Manage Persons" (model of that view is the table persons) which shows a table with all "persons" in it. In this view i can add, delete or change persons. If i now for example change a person and save the changes to the model the table is updated (cause of Data binding). But how can i update the Main-View?

The 2 problems i have are:
1. How do i inform the Main-View that the model of the second view was changed?
2. How do i update the Main-View then, the only thing coming to my mind is reading the projects table again and setting it as the new input of the treeViewer.

Thanks for any answers Smile

(no subject) [message #692568 is a reply to message #691570] Mon, 04 July 2011 18:40 Go to previous message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 423
Registered: July 2009
Senior Member
Hi AmFreak,

1. You have to build some kind of listener model that notifies the main-view
of changes in the model
2. The trigger or event should contain the parent project of the person that
was just modified. You should then use this to lookup the item in the tree
that needs changing and call the treeviewers refresh method. This will call
your content provider again for a fresh list of children.

Regards,

Wim


> Hi,
>
> i have a Main-View with a treeViewer that shows projects and persons as
branches in those projects. The model of the treeViewer is the table
"projects" of a database. The table has a many to many relationship to the
another table called "persons". I have a command that opens a second view
"Manage Persons" (model of that view is the table persons) which shows a
table with all "persons" in it. In this view i can add, delete or change
persons. If i now for example change a person and save the changes to the
model the table is updated (cause of Data binding). But how can i update the
Main-View?
>
> The 2 problems i have are:
> 1. How do i inform the Main-View that the model of the second view was
changed?
> 2. How do i update the Main-View then, the only thing coming to my mind is
reading the projects table again and setting it as the new input of the
treeViewer.
>
> Thanks for any answers :)
Previous Topic:dataBinding and property change notification
Next Topic:Weird error while exporting RCP application
Goto Forum:
  


Current Time: Thu Apr 25 15:18:14 GMT 2024

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

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

Back to the top