Andrew Gilmour
Posts: 0
Joined: Sun May 12, 2013 11:14 am

local variable not refreshing

Hi,

We are building an app that requires a local variable to be set to open a new page. Everything works fine - we can click on a value, it sets a local variable and it then produces the correct data based on the variable. The problem we have is that when we go back to the original page and click on a second variable it is not replacing the initial stored local variable so the same data is being returned.

Can you help?

Kind Regards

Andrew

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

local variable not refreshing

Hello! Could you clarify how do you set localStorage variable? Do you use Set local storage variable action (then what component you use to bind variable). If you use JS please post the code.

Andrew Gilmour5879596
Posts: 0
Joined: Wed May 22, 2013 1:22 pm

local variable not refreshing

Hi Maryna,

We are using Set Local and binding it. Attached is an image showing the set up.

Kind Regards

Andrew Image Image

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

local variable not refreshing

Setting of localStorage variable should work. [quote:]"open a new page ... the same data is being returned"[/quote]perhaps you don't call service second time. How do you call the service?

Andrew Gilmour5879596
Posts: 0
Joined: Wed May 22, 2013 1:22 pm

local variable not refreshing

Hi Maryna,

We are definitely invoking the service as it is producing the correct result when we go to the page for the first time. I will share the app with you - if you get 2 minutes could you take a look? The app is called Yorkshire Apprentice.

Thanks

Andrew

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

local variable not refreshing

Are you rendering all pages in one HTML file?

Andrew Gilmour5879596
Posts: 0
Joined: Wed May 22, 2013 1:22 pm

local variable not refreshing

Hi Maryna,

Yes - the app is set to render all pages in one HTML file.

We still cannot make this work.

Kind Regards

Andrew

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

local variable not refreshing

Hi Andrew,

We've tested - this works. Please check localStorage variable "CompanyID" value in console (F12).

Andrew Gilmour5879596
Posts: 0
Joined: Wed May 22, 2013 1:22 pm

local variable not refreshing

Hi Katya,

Your are right - I can see this in the Local Storage - now I am just confused - it should be returning the correct value. Any ideas on why it is not returning the correct records based on CompanyID?

Kind Regards

Andrew

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

local variable not refreshing

Hello! You call the service on page Load event, please try to use page Show instead.

Return to “Issues”