NetTalk Central

Author Topic: Question on NetRefresh on a webapp.  (Read 4693 times)

lkeyser

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
    • Email
Question on NetRefresh on a webapp.
« on: May 29, 2019, 01:46:24 AM »
Hi Everyone
I have a question on NetRefresh on a webapp.

When I browse a table and update the values, it works perfect as per the example Realtime (85).

My Problem
I change and add records in a different part of the app with some hand code. When this code executes the table browse does not update, although the data do change.
Is there a command that I must send to the webserver to tell it to refresh the table in the hand code?

Many thanks
Louis

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: Question on NetRefresh on a webapp.
« Reply #1 on: May 29, 2019, 02:11:19 AM »
From the docs:

https://www.capesoft.com/docs/NetTalk11/NetTalkWebBasic.htm#NetRefresh

Triggering a table change from the WebServer

You now have browses watching the Host-Table value, and refreshing themselves when that changes. If the table changes via the web interface, or via another desktop app with NetRefresh (on the same LAN as the server) then you are done.

But what if the table changes via some other mechanism - like perhaps code in the WebServer procedure? In this case, in the web server procedure you can use
s_web.SetTableValue('tablename',today() & '-' & clock())

If you are in a WebHandler procedure (like WebHandler, or any NetWebBrowse, NetWebForm etc) then you can use
p_web.SetTableValue('tablename',today() & '-' & clock())

This will trigger a refresh event to the browses that are monitoring the table value.
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11