noclass1980 Active Member Licensed User Longtime User Mar 17, 2013 #1 Hi, I have a table where I can input data manually using the Dialogs lib. Using the AHViewPager I can move to different panels and keep the table data. However, if I change orientation by physically rotating the tablet, all data is lost in the table. how can I keep the table data? do I need to write it to an array and then read it back in if the orientation changes? Thanks.
Hi, I have a table where I can input data manually using the Dialogs lib. Using the AHViewPager I can move to different panels and keep the table data. However, if I change orientation by physically rotating the tablet, all data is lost in the table. how can I keep the table data? do I need to write it to an array and then read it back in if the orientation changes? Thanks.
Erel B4X founder Staff member Licensed User Longtime User Mar 17, 2013 #2 StateManager module saves and restores the state for "standard" views. In your case you will need to implement something similar for the table. Upvote 0
StateManager module saves and restores the state for "standard" views. In your case you will need to implement something similar for the table.
noclass1980 Active Member Licensed User Longtime User Mar 17, 2013 #3 Thanks, I tried the example. For my table do I need to add in the StateManager module in the innerSaveState(v As View, list1 As List) proc some code where v is Table and should the code loop through each cell and add the data to list1? and similarly in the innerRestoreState(v As View, list1 As List) proc? Thanks edit just found that a Table is not a view, so how do I reference a table in a ScrollView as a view so that v=????. can I loop through each cell in the table to assign the cell value to a variable which is added to List1 using the innerRestoreState etc. Last edited: Mar 17, 2013 Upvote 0
Thanks, I tried the example. For my table do I need to add in the StateManager module in the innerSaveState(v As View, list1 As List) proc some code where v is Table and should the code loop through each cell and add the data to list1? and similarly in the innerRestoreState(v As View, list1 As List) proc? Thanks edit just found that a Table is not a view, so how do I reference a table in a ScrollView as a view so that v=????. can I loop through each cell in the table to assign the cell value to a variable which is added to List1 using the innerRestoreState etc.
Erel B4X founder Staff member Licensed User Longtime User Mar 19, 2013 #4 It will be easier to implement it outside of StateManager. You can even use StringUtils.SaveCSV / LoadCSV to save the table. Upvote 0
It will be easier to implement it outside of StateManager. You can even use StringUtils.SaveCSV / LoadCSV to save the table.