iOS MobileScreen refresh

Hi!

how can i force a MobileScreen to “refresh”, like first time open?

i don’t want to show another screen…

var ms as new myHome
ms.show

Alex

Maintain a variable called theMyHomeScreen which points to the opened screen, either in a module or at the app level.

When MyHome opens, do this in the opening event:

App.theMyHomeScreen = me

When you want to refresh it,

theMyHomeScreen.refresh

If you are using Master/Detail view, you might be able to get at the screen without such a variable, using syntax such as

self.ParentSplitView.master.refresh

or

self.ParentSplitView.detail.refresh

There is no “.refresh” for mobileScreen…

image

Huh.

At the risk of sounding like an AI, you’re right.

I went back to my project to see what I was actually doing, and I see I had added a method that refreshes all the individual controls, then I call that.

Why do you need this refresh? Controls will refresh automatically if you change their contents. Canvas being the exception which you should use a timer to invalidate/refresh

lol

when i open my “mobileScreen” the first time, some classes (constructors) are fired and start.

if i change some “filters” i need to “refresh” the mobileScreen so the constructors will start again

This is just not the right approach then. You need to move the logic out of the constructors into a function that you can call later, not delete and recreate all of the objects. You can call that function in the constructor the first time and then from “elsewhere” when filtering

2 Likes