NetTalk Central

Author Topic: NetWebRefresh question  (Read 6478 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
NetWebRefresh question
« on: February 26, 2019, 10:51:47 AM »
I have a Browse that is seen by all the connected users, but the users cant change any data of it.
The variable that says when the browses must be refreshed is generated by another proc caled by a timer.
How can I refresh all that browses when that variable changes?
Something like
if MyVar=true
   p_web.WebRefreshMyBrowse()
end
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: NetWebRefresh question
« Reply #1 on: February 27, 2019, 02:05:10 AM »
For NT11.06 (and some earlier)

  p_web.Webserver.SetTableValue('mailboxes',today() & '-' & clock())

For NT11.07 and later

  p_web.SetTableValue('mailboxes',today() & '-' & clock())
 
cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: NetWebRefresh question
« Reply #2 on: February 28, 2019, 07:57:59 PM »
Ok, thanks, Ive added a button to the webserver window to test it and it works ok.
Now... the event that must fire the refresh is made by another app, a desktop app that calculate when the browses must be refreshed,
What is the best way to Notify the web app from the desktop app that it has to refresh the browses?
Im thinking on saving a ini file with the desktop app and read it using a timer in the webserver window.
Or... can I use NOTIFY between apps?
Or... using NetRefresh from the desktop to the web app?
-----------
Regards
Alberto

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: NetWebRefresh question
« Reply #3 on: February 28, 2019, 09:21:01 PM »
Or..  you could add an API to your webserver.  The API would trigger the browse to refresh.

Your desktop app could use that API whenever it needed to trigger the refresh.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: NetWebRefresh question
« Reply #4 on: March 01, 2019, 12:40:20 AM »
>> Or... using NetRefresh from the desktop to the web app?

NetRefresh works in Desktop apps and web apps. So best option it just to add NetRefresh to the desktop apps as well.

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: NetWebRefresh question
« Reply #5 on: March 01, 2019, 06:38:15 AM »
Trying to do this but it does not work.
Ive added NetRefresh to the Desktop app.
Looking, by example, at one Form proc its sending ok, see first image uPortfolio and its send, sending Posiciones and Cotiza on dependencies.
In the WebServer proc, in this window.tekeevent Ive added the NetLocalDependecies |Posiciones|Cotiza| and it does not work.
Then I thought it the ThisNetRefresh.depend and change the code using Setvalue instead of Setvalues (image 2) but still not working.
What am I doing wrong?
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: NetWebRefresh question
« Reply #6 on: March 03, 2019, 11:31:05 PM »
your code is not correct there, and you should remove it.
Rather check the contents of ThisNetRefresh.depend at that point.

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: NetWebRefresh question
« Reply #7 on: March 04, 2019, 03:31:26 PM »
In the desktop app the Send is ok, its sending, but it never fire the ThisWindow.Reset of the web app.
When the web app is used the  ThisWindow.Reset is fired and the ThisNetRefresh.depend='|'

In the Refreshing tab of the NetRefresh template in the Webserver proc Ive set the Refresh this window even if there is no browse to true and add Cotiza to the list of files and nothing, ThisNetRefresh.depend is always ='|'
-----------
Regards
Alberto

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: NetWebRefresh question
« Reply #8 on: March 06, 2019, 06:05:18 AM »
Ive done a win1.app in the same dir of the web1.app example.
The web1 server refreshes ok te web browses.
The win1 desktop app refreshes ok the win browses but do not refresh the web browses.
It seams that the web app does not receive any notify from the win app
What shoud I do in the desktop app to refresh the Web browses when you change a record using the form?
And what if I need to refresh the web browses using code in a button?
Attached goes the zip containing the full example with both apps (Ive not includede the web folder to make it small)
Thanks
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: NetWebRefresh question
« Reply #9 on: March 07, 2019, 12:59:35 AM »
thanks - I'm out today, but I'll keep you posted tomorrow.

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: NetWebRefresh question
« Reply #10 on: March 07, 2019, 07:45:07 AM »
MY FAULT!
I forgot to set the unique app name.
Its working ok
Thanks
-----------
Regards
Alberto