NetTalk Central

Author Topic: How to refresh a page when triggered  (Read 4370 times)

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
How to refresh a page when triggered
« on: February 22, 2021, 02:20:24 AM »
Hi,

I have an always-present drop list in a header control. When the user changes its selection, I would like to reload the IndexPage using the selection as a filter.

It's easy to detect the new selection in the drop list control. But I'm not sure how to refresh the IndexPage from there. Any help please?

Thanks
Thys

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How to refresh a page when triggered
« Reply #1 on: February 22, 2021, 07:27:39 AM »
Hi Thys,

you _could_ refresh the whole page by forcing a reload, but that's a little uncool.
It's better to refresh those parts of the page that need refreshing... so perhaps refine the question a bit - what specific thing(s) on the page do you want to refresh?

cheers
Bruce

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: How to refresh a page when triggered
« Reply #2 on: February 22, 2021, 09:08:34 PM »
Hi Bruce.

  • A model selection at the top (in page header) governs everything displayed thereafter - like a master filter over all browse controls.
  • After a user has logged in, a dashboard is displayed with stats etc. related to the selected model.
  • Every browse control opened now uses this model selection as a primary filter.
  • What I need, is when the user selects another model, the dashboard needs to be opened with the stats of the new selection.

Attached is a screen shot to give you an idea.

Thanks Bruce.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How to refresh a page when triggered
« Reply #3 on: February 22, 2021, 10:28:08 PM »
in the server-side-code for the drop try;

p_web.script('location.reload();')

Cheers
Bruce

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: How to refresh a page when triggered
« Reply #4 on: February 23, 2021, 01:18:52 AM »
Thanks Bruce, it works.

Where can I read about p_web.script('location.reload();')?

Thys

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: How to refresh a page when triggered
« Reply #5 on: February 23, 2021, 04:48:23 AM »

Hi Thys,

Think it's the same as this one, don't think it's a NT specific function.

https://www.w3schools.com/jsref/met_loc_reload.asp


regards

Johan