Reputation: 51
In my application I have a menu which open a SelectionDialog
, this dialog is used to choose an object.
When this object is selected I have to display it in the view.
What is the best way to update my view?
Currently, I call myview.update(object)
after the dialog is closed (in the handler of the menu). But I think this solution is not well design.
I have read about update my model and notify my view but my model does not change (no data are changed, I only display different Data ).
Does anyone has some ideas for a well design solution ?
Upvotes: 3
Views: 408
Reputation: 3085
Above steps works properly when you have view activated. You need to consider cases like when if view is deactivated or not visible ( make sure you refresh view is visible else you will have unnecessary overhead of refreshing view though it is notvisible)
Upvotes: 1
Reputation: 2718
Try adding a selection listener in the view and register this selection in the dialog.
In the listener action, add the code to show the selected object.
Upvotes: 0