Listview showing old value of field while SQL DB is correctly updated

In screen 1 we have a Listview showing fields fetched from a table in SQL DB. When hitting the button "go to screen 2" the field is updated in the DB (we can see it in real time). However, when returning from Screen2 the screen 1 still shows the old value in the Listview. Upon switching between Screen 1 and 2 3-4 times the field in Listview is updated according to the DB value. Any suggestion?

There is a Screen Event block that fires when returning from another Screen, after that other Screen has done a Close Screen.

That event is a good place to reload Elements and refresh ListViews.

Thank you ABG, but unfortunately it does not give the desired result...

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

First of all thank you for trying to help us. We really need helps since we have been stuck with this issue for many days.
We enter this block first on the .initialize screen and then every time there is a change in the MySQL DB. What we do is to show in the listview the records with an image or without an image depending on the value in index 9 in a item list. This value is set by checking in a timer if a change has occurred in the DB, in that case the value is set to 1. We see that the DB is correctly updated in real time. But when coming back in this screen from the screen that updates the DB, the listview still shows the image where there should not be one. Switching back and forth between the screens
3-4 times the image finally disappears without any change occurred on the DB.

Why do all your event, procedure and variable blocks have red crosses?

Show us the blocks that switch screens.

They have red crosses since the block is moved out to a backup empty screen and we are trying different ways to make it work in the actual screen.


How to switch screens correctly

Taifun

Thanks, yes we have done this too but no help in that unfortunately.

  1. switch screens correctly
  2. before displaying any data, read it from the database
  3. do the final test using the apk file... why? Read again the notes in the manager screen tutorial

If that still does not work, provide an updated screenshot of your relevant blocks
Taifun