iOS Question CLV & showpage

Uniko Sistemi srl

Active Member
Licensed User
Hello everybody. i have problem that i just can't solve.
it only happens in b4i, while on b4a it works perfectly.
I have two pages (a homepage and page1)
in page1 I have a clv (in which I upload a panel) that downloads a list of files from an FTP server. it happens that when I start the app the first time I enter page 1 and the files are displayed correctly, but if I go back to the home and return to page 1 I see the clv still with the old data. how can i clean the clv or make sure that when i return to page 1 it reloads everything as if it were the first time? because with the clear command it just doesn't let me see the CLV anymore.
i tried root.removeallviews
i tried to reload in appear, but it always works only on android, on ios not.
does anyone know if the CLV behave differently on b4i or b4a?

a thousand thanks
 

Uniko Sistemi srl

Active Member
Licensed User
Post some code...
thank you.
I put my code block in your threepages example and the same thing happens. when i go back from page3 and i re-enter the list is full and behaves like i don't understand. this only happens on ios. on android if I go back and return to page 3 the list fills up normally.
sorry if I made some mistake in zipping the project, but it's the first time. I thank you
 

Attachments

  • B4iProject.zip
    189.3 KB · Views: 73
Upvote 0

Uniko Sistemi srl

Active Member
Licensed User
No need to call clv.Refresh.

The page is only created once.
You are filling the list in B4XPage_Appear which means that every time it will add more items to the same list.

I think that you should move all the code from B4XPage_Appear to B4XPage_Created.

a thousand thanks. i tried to do this, but the clvlist always remains with all items loaded the time before. How can I empty it or have it recharged correctly the second time I return?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
A common mistake with B4XPages is to treat the pages as the (dreadful) activities. Once the page was created you can access its elements whenever you need.
If you want to update the list simple clear it and update it. Don't do it in B4XPage_Appear as you are just making things more complicated.

B4X:
Page17.clv.Clear
Page17.FillCLVWithNewData
 
Upvote 0

Uniko Sistemi srl

Active Member
Licensed User
A common mistake with B4XPages is to treat the pages as the (dreadful) activities. Once the page was created you can access its elements whenever you need.
If you want to update the list simple clear it and update it. Don't do it in B4XPage_Appear as you are just making things more complicated.

B4X:
Page17.clv.Clear
Page17.FillCLVWithNewData
thank you. unfortunately this only works for android. on ios if I run clear the list is completely emptied and does not let me insert anything else in it. i don't understand why they behave differently on ios and android. I am going crazy
I would gladly pay to fix it!
 
Upvote 0
Top