Project

General

Profile

Simultaneous updates in multiple browsers.

Added by Vasya Pupkin over 10 years ago

I have a static AbstractItemModel derived instance. Every time a new session is launched I create a table view and a tree view and set the existing static model to them.

Everything is working fine with exception of updates. If I edit the data in one view the model fires a signal dataChanged().emit(index1, index2);

Both the tree and table in the active browser are updated correctly. However views in other browsers are not, until I go there and do some actions that force them to reread the data from the model ( usually I scroll the slider in the table view).

Stepping through the code revealed nothing. The signal goes to all views in all sessions and seems to go through the same code. Still the inactive client does not get updated.

Is there a way around it ?


Replies (2)

RE: Simultaneous updates in multiple browsers. - Added by Peter K over 10 years ago

As far as I know, you need to update every other running session from your current session by making a call to WServer::post(...). The function that you pass with the post() probably needs to call WApplication::triggerUpdate(). Server-side updates also need to be allowed with WApplication::enableUpdates().

Peter

RE: Simultaneous updates in multiple browsers. - Added by Wim Dumon over 10 years ago

That would be correct, but... you must NOT share a AbstractItemModel between sessions. This will not work, and lead to a large collection of concurrency problems.

BR,

Wim.

    (1-2/2)