F fdx12345 Active Member Licensed User Longtime User Dec 23, 2012 #1 I need to be able to hide a Table(s) including headers until needed without messing with the data. Is there an easy way of doing this? I did see a hide parameter to the List of Table commands.
I need to be able to hide a Table(s) including headers until needed without messing with the data. Is there an easy way of doing this? I did see a hide parameter to the List of Table commands.
mangojack Expert Licensed User Longtime User Dec 23, 2012 #2 I'm still in the learning process here myself , but presently working with tables i'll have a shot .. Is your table on a panel .. if so just hide panel ?? cheers mj Upvote 0
I'm still in the learning process here myself , but presently working with tables i'll have a shot .. Is your table on a panel .. if so just hide panel ?? cheers mj
F fdx12345 Active Member Licensed User Longtime User Dec 23, 2012 #3 Hide a Panel The Table is a Class developed, I believe, by the developers of Basic4Android. I have thought about looking at the class and playing with the panel but if the Class ever gets put into a library, then I may never know the name of the panel they used. I was hoping there was a command to hide the panel. If not, I can add one but it would never be included in any upgrade or future changes. Upvote 0
Hide a Panel The Table is a Class developed, I believe, by the developers of Basic4Android. I have thought about looking at the class and playing with the panel but if the Class ever gets put into a library, then I may never know the name of the panel they used. I was hoping there was a command to hide the panel. If not, I can add one but it would never be included in any upgrade or future changes.
mrjaw Active Member Licensed User Longtime User Dec 23, 2012 #4 As says mangojack just hide the panel. The problem is that when you try to fill again the table it is not appear. I post a related problem using the technique to hide the panel. Upvote 0
As says mangojack just hide the panel. The problem is that when you try to fill again the table it is not appear. I post a related problem using the technique to hide the panel.
mangojack Expert Licensed User Longtime User Dec 23, 2012 #5 My bad .. I was using the table class .. but wanted to include images so switched to the custom list view .. but prior to that i was loading two seperate tables on panels which could be hidden/shown without losing data . Cheers mj Upvote 0
My bad .. I was using the table class .. but wanted to include images so switched to the custom list view .. but prior to that i was loading two seperate tables on panels which could be hidden/shown without losing data . Cheers mj
mrjaw Active Member Licensed User Longtime User Dec 23, 2012 #6 I am using a Table module too but this works fine the first time the second time when I fill the table doesnt appear in the table. You can see the problem here Upvote 0
I am using a Table module too but this works fine the first time the second time when I fill the table doesnt appear in the table. You can see the problem here
mrjaw Active Member Licensed User Longtime User Dec 23, 2012 #7 Sorry...here http://www.b4x.com/forum/basic4andr...-doesnt-show-data-second-time-bug-2-30-a.html I have an attachment with the project and panels. Upvote 0
Sorry...here http://www.b4x.com/forum/basic4andr...-doesnt-show-data-second-time-bug-2-30-a.html I have an attachment with the project and panels.
mangojack Expert Licensed User Longtime User Dec 23, 2012 #8 Ill take one last shot at this ..cause i'm getting in over my head here .. lol are you not loading your table to the activity instead of adding the table to one of the panels Sub Button1_Click If TableProd.IsInitialized = False Then TableProd.Initialize(Me, "TableProd", 2) TableProd.AddToActivity(paneltabla, 0, 2%y, 100%x, 70%y) possibly should be ..... panel1.AddView(TableProd.AsView, 0,2%y , panel1.Width, 70%y) cheers mj Upvote 0
Ill take one last shot at this ..cause i'm getting in over my head here .. lol are you not loading your table to the activity instead of adding the table to one of the panels Sub Button1_Click If TableProd.IsInitialized = False Then TableProd.Initialize(Me, "TableProd", 2) TableProd.AddToActivity(paneltabla, 0, 2%y, 100%x, 70%y) possibly should be ..... panel1.AddView(TableProd.AsView, 0,2%y , panel1.Width, 70%y) cheers mj
mrjaw Active Member Licensed User Longtime User Dec 23, 2012 #9 This works becuase I add the table to panel. So remember the first time works fine. U try this project? Try second time to fill the table Upvote 0
This works becuase I add the table to panel. So remember the first time works fine. U try this project? Try second time to fill the table
mangojack Expert Licensed User Longtime User Dec 23, 2012 #10 mrjaw my last post possible correction to your code was not correct ... I am unable to explain why your code does not work but was able to load the table numerous times by changing layout slightly. ie .. Back button clears table .. Load button reloads this might not be desired for what you plan .. cheers mj Last edited: Dec 23, 2012 Upvote 0
mrjaw my last post possible correction to your code was not correct ... I am unable to explain why your code does not work but was able to load the table numerous times by changing layout slightly. ie .. Back button clears table .. Load button reloads this might not be desired for what you plan .. cheers mj
F fdx12345 Active Member Licensed User Longtime User Dec 23, 2012 #11 Hiding the table - my solution I fixed the problem by adding a hiding sub in the Table Class. This works fine, least until the time comes for the class to be updated. Upvote 0
Hiding the table - my solution I fixed the problem by adding a hiding sub in the Table Class. This works fine, least until the time comes for the class to be updated.
klaus Expert Licensed User Longtime User Dec 23, 2012 #12 You don't need a Hide method in the class code. When you initialize the table you put it on a panel. Setting the panels Visibility property to False hides the table. Best regards. Upvote 0
You don't need a Hide method in the class code. When you initialize the table you put it on a panel. Setting the panels Visibility property to False hides the table. Best regards.
F fdx12345 Active Member Licensed User Longtime User Dec 23, 2012 #13 Panel names When I initialized Table I used the code: Table1.Initialize(Callbackmodule, eventname, numberof columns). This will run the initialize routine in the Table Class. If I was not able to see the code for the class, I would not know what was happening in that routine and what the panel was named. I did not see any commands to the Table1.xxxx which would allow me to make either panel visible much less the main panel. Turns out the Table class uses two panels. One for the Header and one for the actual table data. The main panel is called Panel not Panel1 and the one used for the header row is called Header not Panel2. I do not know of a way of hiding both panels in a table from the users main module without knowing the name of those panel. However, I am not the brightest cookie in this area. Is there a way of hiding both panels from the users main module? What if more than one table is used? Thanks for the help. Upvote 0
Panel names When I initialized Table I used the code: Table1.Initialize(Callbackmodule, eventname, numberof columns). This will run the initialize routine in the Table Class. If I was not able to see the code for the class, I would not know what was happening in that routine and what the panel was named. I did not see any commands to the Table1.xxxx which would allow me to make either panel visible much less the main panel. Turns out the Table class uses two panels. One for the Header and one for the actual table data. The main panel is called Panel not Panel1 and the one used for the header row is called Header not Panel2. I do not know of a way of hiding both panels in a table from the users main module without knowing the name of those panel. However, I am not the brightest cookie in this area. Is there a way of hiding both panels from the users main module? What if more than one table is used? Thanks for the help.
stu14t Active Member Licensed User Longtime User Dec 23, 2012 #14 You have to place the table on your own panel (Created in code or the designer) and then hide that, not the panels within the table class. I created a panel in the designer and then placed it on the tabhost (or activity). I then add the table to the panel (Paneltab) Code: Table1.Initialize (Me, "Table1", 3) Table1.AddToActivity(PanelTab, 0dip, 0dip, 150dip, 380dip) Table1.HeaderColor = Colors.LightGray I can then hide that panel Code: PanelTab.Visible = False Last edited: Dec 23, 2012 Upvote 0
You have to place the table on your own panel (Created in code or the designer) and then hide that, not the panels within the table class. I created a panel in the designer and then placed it on the tabhost (or activity). I then add the table to the panel (Paneltab) Code: Table1.Initialize (Me, "Table1", 3) Table1.AddToActivity(PanelTab, 0dip, 0dip, 150dip, 380dip) Table1.HeaderColor = Colors.LightGray I can then hide that panel Code: PanelTab.Visible = False
klaus Expert Licensed User Longtime User Dec 23, 2012 #15 Attached you find Erels' example modified with two buttons allowing to hide and show two tables. Instead of adding the tables onto the activity I added two panels and added one table on each panel. Using Table1.AddToActivity(pnlTable1, 0, 0, pnlTable1.Width, pnlTable1.Height) instead of Table1.AddToActivity(Activity, 0, 0, 100%x, 50%y) Best regards. Attachments TablesOnPanels.zip TablesOnPanels.zip 15.2 KB · Views: 311 Upvote 0
Attached you find Erels' example modified with two buttons allowing to hide and show two tables. Instead of adding the tables onto the activity I added two panels and added one table on each panel. Using Table1.AddToActivity(pnlTable1, 0, 0, pnlTable1.Width, pnlTable1.Height) instead of Table1.AddToActivity(Activity, 0, 0, 100%x, 50%y) Best regards.
F fdx12345 Active Member Licensed User Longtime User Dec 23, 2012 #16 Thank you Great! I will do it that way. Upvote 0