Project

General

Profile

Actions

Support #4853

closed

Model data on server side

Added by Martin Wijk over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
04/09/2016
Due date:
% Done:

0%

Estimated time:

Description

Hi! I am just starting with Wt C and I only see examples with models on client side. In other words, each time a page is loaded, a new model is created. I have a server doing some data collection. Is it possible to expose the same data to all clients?

And, each time a row is added to the model, all clients should be updated.

Any C example or hint is appreciated folks.

Martin

BTW:

Passing a model pointer with the addEntryPoint function results in a segm fault when the model wants to update the view:

server.addEntryPoint(Wt::Application, boost::bind(createApplication, _1, boost::ref(model)));

Actions #1

Updated by Wim Dumon over 8 years ago

  • Status changed from New to Resolved

Hey Martin,

shared models (i.e. one model shared by many sessions) are not support in Wt. You will have to instantiate your model in each class separately, and for the data updates I suggest that when the data changes, you use WServer::post() to notify all sessions that a data update is to be performed.

Wim.

Actions #2

Updated by Koen Deforche over 8 years ago

  • Status changed from Resolved to Closed
  • Target version set to 3.3.6
Actions

Also available in: Atom PDF