Table doesnt show data second time. Bug in 2.30?

mrjaw

Active Member
Licensed User
Longtime User
Hi!
I am using a table to show a data using a button in my layout. When I push the button I load the second layout and hide the first panel to show the panel where is the table everything is fine so far.

When I fill the table I see the rows of my table when I press the BAck button, it is a mine button, I load the first layout and hide the second panel but now the objects that were in the first panel lost the data and if I try to create again the table with rows I cant do it but I see that the table is created.

I attach the project to see my problem. In the first layout I have 3 spinners but when I call the second layout the spinners lost the data.

Any cluees? U can see the attachment.
 

Attachments

  • TablePanels.zip
    11.9 KB · Views: 192

mrjaw

Active Member
Licensed User
Longtime User
I load layout , this recreate the new layout again ? Anyway, for the second case about spinner maybe fine for the first second abaout table no.
I dont undertstood fine I need to use panels instead of loadlayout ?

How can go to an existing layout without "LoadLayout"?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Attached you find a modifyed version.
When you reload a layout file you initiate new views on top of the previous ones and hide them, but these views are empty.
You should load the layout files only once.
And 'play' with the Visible property of the Panels.

Best regards.
 

Attachments

  • TablePanels1.zip
    12 KB · Views: 220
Upvote 0

mrjaw

Active Member
Licensed User
Longtime User
Thks!! Klaus works fine.!! Another question about the performance
I have 8 layout different using panels like this, the performance can be affected because theses layout all load to memory ?

I am worried about this concern .
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
If you don't have big images I don't think there will be any trouble with 8 panels.
The 'standard' working method of Android is to work with different activities instead of panels.
The navigation between different screens is much easier with activities than with panels because the most part is done by the OS.
But quite some applications work with sliding panels.

Best regards.
 
Upvote 0

mrjaw

Active Member
Licensed User
Longtime User
My problem with activities is that I need to transfer information and the activitie be destroyed anytime orientation change. Anyway, I can so many activities that I want without concern about this.
My panels just are spinner and labels.
 
Upvote 0

mrjaw

Active Member
Licensed User
Longtime User
How can I move between activities. For example I have A activity and from this call the activity B when the activity B finish it back where it was called?

I mean I need to find customers show activity with all customer select one customer and come back to where it was called
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
My problem with activities is that I need to transfer information and the activitie be destroyed anytime orientation change.
Even with one activity and different panels when you chage orientation the activity will be paused and restarted again and it's up to you to manage what panel was shown last and should be shown.
How can I move between activities.
Have look at the Beginner's Guide there you have an example with three activities.
Did you have a look at this thread Different examples with 2 layouts?

When I began with B4A I used mainly one activity with several panels and then I changed my mind and moved to several activities.

Best regards.
 
Upvote 0

mrjaw

Active Member
Licensed User
Longtime User
Thks, Klaus.! You were rigth!! Much better with activities. I changed too
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…