Skip to main content
Tuoman
Senior II
February 11, 2021
Solved

Correct way to reload View?

  • February 11, 2021
  • 3 replies
  • 1104 views

I need to reload view completely after major external changes. I don't want to reset each state manually.

What is the correct way to do this? Is this the only way?

void MyView::reloadView()
{
 application().gotoMyScreenNoTransition();
}

This works fine, but requires custom handles for each view.

This topic has been closed for replies.
Best answer by Alexandre RENOUX

Hello Tuoman,

As Romain said, transitioning to the same screen is a good and easy way to reset the states of a screen. Right now, we don't have other specific way to perform this.

When your question is answered, please close this topic by choosing Select as Best.

/Alexandre

3 replies

Romain DIELEMAN
ST Employee
February 11, 2021

Hi,

​

I would do it the same way as well but there might be a better way :grinning_face_with_sweat:. What kind of "major external changes" are you doing ? It seems interesting.

/Romain

Tuoman
TuomanAuthor
Senior II
February 11, 2021

Ok. This works, unless ST wants to add "reload" function to TouchGFX views.

>What kind of "major external changes" are you doing ? It seems interesting.

This device loads&displays data from external devices. When these devices are plugged in/out, I want to reset the view and all its contents&states, instead of manually resetting everything.

Alexandre RENOUX
Alexandre RENOUXBest answer
Visitor II
February 22, 2021

Hello Tuoman,

As Romain said, transitioning to the same screen is a good and easy way to reset the states of a screen. Right now, we don't have other specific way to perform this.

When your question is answered, please close this topic by choosing Select as Best.

/Alexandre