NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: rupertvz on April 21, 2025, 09:39:41 AM
-
Hi All,
I have a value in the NWB header.
I would like to "refresh" this value, every time a new record is added via the NWF.
I tried enabling the option "Refresh Header on Save", but the NWF hangs when this option is selected.
Is there another way to refresh the value in the NWB header?
-
Hi
When I do this, I use a host value updated via websocket. Then all logged in users see the value immediately.
/Niels
-
Thank you Niels,
I have not yet updated hostvalues via WebSocket.
Are you able to give me a little direction?
-
Check the web34 "Calculator" example app.
The Performance procedure has stats updated with websockets. (It's not on the menu so you need to enter the URL manually in your web browser.)
On the fields in the template, notice the "Live via WebSocket" checkbox ticked.
Check out this: https://www.capesoft.com/docs/NetTalk14/NetTalkWebBasic.htm#WebSockets
And search for "socket" on this page: https://www.capesoft.com/docs/NetTalk14/NetTalkWebFunctionality.htm#NetWebForm
If you have Bruce's book "Developing Web Applications with NetTalk - Fourth Edition" you can read the chapter on Web Sockets.
-
define what you mean by "browse header" ?
-
Hi Bruce,
Kindly see attached for the HTML section for the NWB.
Regards
Rupert
-
ahhh - so when you said "the browse header" you meant in a routine that you happened to name "header".
A small detail, that probably matters with regard to the answers.
The item you are updating in this header, is it specific to this user, or common across all users using the server? It seems like it's a value unique to this user?
Your best option is to make a small example app showing what it is you want to do, and I can look at that and suggest something from there...
Cheers
Bruce
-
Thank you Bruce,
I will make an example app,
It is however very simple, for every record inserted into the NWB by the user, the total no of records (or quantities captured by the user) must show in the NWB HTML "header".
I need to show the total in the top (header) section, thus cannot use column totalling.
-
Hi rupertvz,
Why dont add the Browse inside a memory form, then add a field for the total above the browse?
this way this field will be easily refreshed.
Regards
-
I always use that approach that mention Alberto
-
Thank you Alberto, Osquiabro,
I tried this approach also, putting the NWB inside a memory form.
But I can't get the value on the memory form to refresh with the latest record added to the NWB.
How do you refresh the value? As the control-name does not show up to refresh from the NWB side.
Maybe I am missing something?
-
in GotFocusBack refresh your value or send to a routine that recalculate and then refresh,
other options in Reset other fields in your browse inside the memory form reset yor values
-
Thank you Osquiabro,
I've tried what you've suggested, but the memory-form does not seem to get focus - after a record is added in the NWB under the memory-form.
Thus GotFocusBack embed is not firing. Any ideas?
-
Is it possible for you to create an example?
-
Hi,
If your Memory Form IS the Update itself, then there probably won't be any GotFocusBack since it will still be in focus (never lost focus). I might attempt a memory form with the variable and GP TO ANOTHER PROCEDURE which actually does the insert the form. WHen the form is completed and the record inserted, "the program" returns to the Memory Form itself - then the GotFocusBack should trigger and you can update your variable.
Ron