Project

General

Profile

Wt is not refreshing a page appropriately

Added by Loren Burkholder over 2 years ago

Before I get started, I just want to say that Wt is pretty cool.

However, I have been playing around with writing a very simple demo chat application, and I have discovered that Wt is not updating my pages as it should be. The chat app is set up as follows: When a user types a message into the WLineEdit on the page and clicks the Send button, my app pushes the message, along with the sender's IP address for ID, to the end of an std::vector> that is stored in a database class. (I am using a global variable for this database. I know, I know, bad programming practice, but this is not supposed to be production code.) The database then emits a signal that contains the new message. Each WApplication instance is connected to this signal. The connection appends the message to a WText object displayed on the main page. The problem is that the only page that updates immediately is the page that sent the message. If I send a message from another page, that second page will load all previous messages as well as the just-sent message.

I cannot figure out why this is happening and I would be happy if somebody could shed a little light on the subject. The code is available at https://github.com/LorenDB/wt-playground.

Thanks in advance.


Replies (1)

RE: Wt is not refreshing a page appropriately - Added by Loren Burkholder over 2 years ago

Sorry, just realized that this double-posted. I was getting weird Redmine errors when I clicked "Create" and didn't realize that it was actually posted the first time. :P

    (1-1/1)