NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: gavinwebb on April 09, 2012, 06:15:33 AM
-
I have a browse, on this browse I have a button behind which is some server code - this all works.
What I want to happen after the server code has run is for the entire page to refresh - this is because some display data in the page header needs to refresh.
Can't seem to figure out how to do this.
-
Hi Gavin,
If you need to refresh the header, then the best option is to just refresh the header.
I haven't tried this, this morning, but you should just be able to call the header procedure in the "server code". As in;
p_web.SetValue('_parentProc_','')
GenericPageHeaderTag(p_web)
and it will refresh.
Let me know if it works.
There is a command to refresh the whole page, but just refreshing the header would be better.
cheers
Bruce
-
Thanks Bruce, but no this didn't work. Doesn't appear to do anything. If I refresh the page manually using the browser refresh then the header changes.
-
Bruce, can you please tell me how to refresh the entire page - I have looked in the manual, the building applications document and Nettalk Central but can't find out how?
-
Hi Gavin,
Use:
p_web.Script('window.location.href=window.location.href;')
Works great!
Best regards
Jeffrey
-
I think Jeffrey meant;
p_web.Script('window.location.href="www.whatever.com";')
but the context is all-important.
I made a tweak in 6.28 which may allow your header to refresh, as suggested at the top of this thread, but ultimately context is very important here, so a small example would be appreciated if you don't come right.
cheers
Bruce
-
p_web.Script('window.location.href=window.location.href;')
Hi Bruce,
The above line does refresh my current page very well.
So I don't have to add an url like www.mysite.com/etc.
Best regards
Jeffrey
-
oh, yes, ok.... I see what you're doing... good tip...
cheers
Bruce
-
Hi Bruce, Jeffrey,
I have a frame-page with a menu in the left frame.
The menu has login and log-out buttons.
The target frame (right) refreshes during login / logout procedure.
How do I refresh the left-frame also, as I'd like to hide the login button when already logged in.
Thanks
Rupert
-
Hi Rupert,
Sorry, I don't know.
I don't use any frames in my NT app.
Best regards
Jeffrey
-
Rupert,
you can't refresh 2 frames with one request.
what you can do though is refresh the whole frameset, by setting the URL to be the frameset procedure and setting the target to '_top'
Frames are somewhat out of fashion now, because they have some limitations, especially when you want to move to mobile. This document explains how to convrt your app to be non-frames.
http://www.capesoft.com/docs/NetTalk6/NetWebTasks.htm#ConvertFrames
cheers
Bruce
-
Thanks for the advice Bruce,
I converted my frame-page to non-frame by means of your doc.
It is working well and looking good :-)
Just one question.
The "alert" prompt "LOGIN FAILED" (as for example in the login procedure), pushes the NetWebForm below the menu on the left. It doesn't keep to it's "framed" position.
Is there an easy way to make this work?
Regards
Rupert
[attachment deleted by admin]
-
add the style
'nt-width-80'
to that Div.
You can do this globally in the WebServer procedure.
cheers
Bruce
-
Hi All,
I have a similar problem, but this does not work.
p_web.Script('window.location.href=window.location.href;')
My situation is on a _pop-up form_, where there are 4 statuses, all the fields (and there is a lot) on the form is Read-Only for 2 statuses, so as oposed to add all the fields to the Reset list on the Cient-Side Tab of the Status field, I would really like to simply Refresh the entire _Form_.
The above command takes me back to the Browse, and I tried p_web.Script('window.location.href="Update PDetails";'), which goes to the page "The information you requested is not available".
Any ideas please?
Thanks
Charl
-
yeah I don't think that would work with a popup. If you have lots of fields to refresh on lots of fields it's quicker to hand code them and just copy them around. Just examine the source code of the ones added to the template.