NetTalk Central

Author Topic: Refresh an entire page  (Read 5430 times)

gavinwebb

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Email
Refresh an entire page
« 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.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11199
    • View Profile
Re: Refresh an entire page
« Reply #1 on: April 09, 2012, 08:10:53 PM »
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

« Last Edit: May 23, 2012, 05:45:48 AM by Bruce »

gavinwebb

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Email
Re: Refresh an entire page
« Reply #2 on: April 12, 2012, 07:57:26 AM »
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.

gavinwebb

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Email
Re: Refresh an entire page
« Reply #3 on: April 29, 2012, 06:43:40 AM »
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?

Jeffrey Kuijt

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Email
Re: Refresh an entire page
« Reply #4 on: April 29, 2012, 11:45:40 AM »
Hi Gavin,

Use:

p_web.Script('window.location.href=window.location.href;')

Works great!

Best regards
Jeffrey

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11199
    • View Profile
Re: Refresh an entire page
« Reply #5 on: April 29, 2012, 09:56:50 PM »
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

Jeffrey Kuijt

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Email
Re: Refresh an entire page
« Reply #6 on: April 29, 2012, 10:34:51 PM »

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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11199
    • View Profile
Re: Refresh an entire page
« Reply #7 on: April 30, 2012, 08:07:54 PM »
oh, yes, ok.... I see what you're doing... good tip...

cheers
Bruce

rupertvz

  • Sr. Member
  • ****
  • Posts: 316
    • View Profile
    • Email
Re: Refresh an entire page
« Reply #8 on: May 21, 2012, 03:20:45 PM »
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

Jeffrey Kuijt

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Email
Re: Refresh an entire page
« Reply #9 on: May 21, 2012, 08:49:38 PM »
Hi Rupert,

Sorry, I don't know.
I don't use any frames in my NT app.

Best regards
Jeffrey

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11199
    • View Profile
Re: Refresh an entire page
« Reply #10 on: May 22, 2012, 12:43:06 AM »
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

rupertvz

  • Sr. Member
  • ****
  • Posts: 316
    • View Profile
    • Email
Re: Refresh an entire page
« Reply #11 on: May 23, 2012, 05:29:41 AM »
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]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11199
    • View Profile
Re: Refresh an entire page
« Reply #12 on: May 23, 2012, 05:46:44 AM »
add the style
'nt-width-80'
to that Div.

You can do this globally in the WebServer procedure.

cheers
Bruce

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Refresh an entire page
« Reply #13 on: May 23, 2012, 06:05:35 AM »
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


kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Refresh an entire page
« Reply #14 on: May 23, 2012, 09:14:36 PM »
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.