Hi All,
I have a timer set to update context (OnTimerEnd) to show the date and time on 2 text boxes.
UpdateContext({time:Text(Now(),"[$-en-US]hh:mm:ss")});UpdateContext({date:Text(Now(),"[$-en-US]dd/mm/yy ")})
I would like this to run when the screen is not visible (OnHidden) so I can use the text from the updated labels throughout the app. This will save me creating a timer function for every screen that is visible.
Any ideas?
Solved! Go to Solution.
Hi @Courtney ,
I agree with @iAm_ManCat's opinion about Timer.
I'm afraid it's not supported to make a Timer keeps running when you are in other screens.
So your current problem is about how to update data and fill color of a textinput when you are in other screens?
The answer is yes. You could change a textinput's data and fill color from other screens.
I've made a similar test for your reference:
in screen1, if I click a button, I will change the text and fill color of a button that is in screen2.
1)in screen1
set the button's OnSelect:
Set(var,true);Reset(TextInput1)
2)in screen2
set the textinput's Default:
If(var,"test")
set the textinput's Fill:
If(var,Red,White)
If you click the button in screen1, the button in screen2 will display text "test" and its fill color will change from white to red.
Best regards,
Heya!
Timers can only run while the screen they are on is currently visible, so if I'm understanding correctly then you want the timer to run while you are on another screen? If yes, then that's not currently possible as timers dont 'play' unless you are on the screen that the timer is on, so you'd have to create multiple timers, one for each screen if you want them to update values while on another screen,
Its a limitation I've had to deal with before, and currently the only way is to have multiple timers.
I also usually set global variables with the timers so that they are screen-independent, that way the other timers can update the same global variable when they OnTimerEnd,
Cheers,
Sancho
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
Thanks! @iAm_ManCat I thought this approach would help to avoid the issue I am having with where things seem to fall apart "Check your twitter as I caught the problem on camera at last!"
I was also trying to update a text box off-screen when a user presses a button using the Set function as this is a global variable but I just got it working. Would also like to change the fill colour of the same text box but can't figure that out.
Hi @Courtney ,
I agree with @iAm_ManCat's opinion about Timer.
I'm afraid it's not supported to make a Timer keeps running when you are in other screens.
So your current problem is about how to update data and fill color of a textinput when you are in other screens?
The answer is yes. You could change a textinput's data and fill color from other screens.
I've made a similar test for your reference:
in screen1, if I click a button, I will change the text and fill color of a button that is in screen2.
1)in screen1
set the button's OnSelect:
Set(var,true);Reset(TextInput1)
2)in screen2
set the textinput's Default:
If(var,"test")
set the textinput's Fill:
If(var,Red,White)
If you click the button in screen1, the button in screen2 will display text "test" and its fill color will change from white to red.
Best regards,
User | Count |
---|---|
183 | |
108 | |
88 | |
44 | |
43 |
User | Count |
---|---|
226 | |
108 | |
105 | |
68 | |
68 |