Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Jason Herrington
2
Views
2
Comments
change in database driving update on webpage
Question
I have asked this awhile back but not able to find a good answer.
What we want to do is have something on the server force an update on a page. The best example I can think of this is say you have 5 widgets in stock. Say 2 people both have a page open where they can buy a widget. Person 1 buys 2 widgets. We would then want person 2's webpage to update (an ajax refresh of just the section with the quantity available) to update to say there are 3 widgets available.
Any ideas on how to do that?
Hélio Dolores
Staff
Hi Jason,
The application servers are stateless, this means that they don't know which pages are currently open by whom. The "supported" way of checking these things is basically "check the state every X seconds/minutes" with javascript/Ajax.
There are other ways of doing this. You can have a Node.js server with websockets that will react in javascript when they receive a message from the outsystems server. This means that you will have to define a protocoll that will somehow sinchronize the numbers between the outsystems server and the node.js server.
Example:
You can trigger a process in OutSystems (on create Entity) that will communicate the current number of products to the Node.js server to broadcast a message to all the users with open sockets on that page.
The problem with these integrations is that you'll have to deal with scaling, synchronizations, staging, ... of the Node.js by yourself. And you'll have tons of javascript to create and maintain.
Hélio
Jason Herrington
Helio,
Ok, thank you. Had hoped there was an easier way to do that.
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...