SV not showing last line of table

fdx12345

Active Member
Licensed User
Longtime User
I am using a Table from the Table class which is working fine except when I end up with enough entries to required the services of the SV, the SV will allow me to scroll all the way down to the next to the last entry. I cannot see the last entry.

What do I need to add or change to fix this?
 

fdx12345

Active Member
Licensed User
Longtime User
Scrollview height

I am not dealing with the sV specifically but rather letting the Table Class handle all of that issue. I do not even declare a SV in my main module.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
You probably have something like this (with different values) in your main activity code:
B4X:
Table2.AddToActivity(Activity, 0, 40%y, 100%x, 60%y)
Try to lower the last value. For instancew, change 60%y to 55%y or something lower.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Well, without seeing your code we can only try to guess what mistake you could have done.
So post your project as a zip file or at least a smaller one that shows the problem and we look at it otherwise at least I couldn't help you further.

Best regards.
 
Upvote 0

fdx12345

Active Member
Licensed User
Longtime User
Attached is a zip of my project

I will need to delete the zip file off the board when finished but it is complete.
 
Last edited:
Upvote 0

fdx12345

Active Member
Licensed User
Longtime User
That file is an empty text file

When the user inputs bank information, it is saved to that file (for the time being).
 
Upvote 0

fdx12345

Active Member
Licensed User
Longtime User
the other file

The other file csv, is an empty file also. When the user adds data to a table, it gets saved into that file for reloading later. If no data in a table, then file is empty.
 
Upvote 0

fdx12345

Active Member
Licensed User
Longtime User
Will need to add data

The program is designed to load blank support files if run the first time. To see the problem, you will need to load 8-10 Bills via the Add Bill section then go look at the result and try to see the last one added. If you add another one, the one you could not see is now visible but not the one you added last.

I have not gotten to the part of checking if an external card is present thus everything is done to the external card because I have one. When it is done, I will change the program to check for external card instead of just assuming one exist.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I see it too now.
The problem is that there is something hiding the bottom part of the scrollview. I haven't found what.
I suspect that it could be the special initialization method for the tables.
You initialize two times each table and you add the first instance onto the acvtivity and then you really initialize and add it in the table in the class, strange.
I suppose that you did this to be able to hide tables. I'm estonished that this does work.
You should modify it:
- Add in the class a Hide function where you set the SVs and Headers Visible property.
- Then call BudgetTable(i).Hide(True) or BudgetTable(i).Hide(False)
I haven't modifyed the program it will take too much time.
You have modifyed the header height in the class with absolute pixel values you should use 65dip instead of 100 in lines 146 and 147 and replace 64dip in line 271. A better solution would be to add a variable HeaderHeight.
Be careful, it's possible to enter a line without values which throws an error in the DoMath routine you should check if all fields have valid data.

Best regards.
 
Upvote 0

fdx12345

Active Member
Licensed User
Longtime User
thank you

I hope we can figure this out. I have a panel at the bottom which I use to total up the values of columns in the table but the tables are located above that panel.

I wish I could say I knew what I was doing but I was leaning as I was going and then turning what I had learned into something complex by using array methods for all of the tables. The array method cut down a lot of code ( I think... now I am not so sure). I am able to hide tables by hiding the assoicated panel. I can also use the same code for all the tables by changing the index of the table/panel array and running it through the same routines.

What took a little thought was how to stuff 12 tables into 1 external storage file then read it back correctly. The examples only showed how to stuff one table.
 
Upvote 0

fdx12345

Active Member
Licensed User
Longtime User
Initializing tables twice

I need to digest the initializing twice. I thought I was following the example on boards. I need to look at the examples again.

I never thought about it until you mentioned the duplication but it could be I tried following code from examples which did not have a seperate Table Class. Come to think of it, I believe only one of those examples (there are 3 or 4) has a seperate Table class file, the rest just has the Table information include in the main module.

It is the little bitty things like this which has kept me up late at night.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I spent also some time to find what happend.
Another point:
You are initializing the table with an event name.
B4X:
Select i
    Case 1
        BudgetPanel(i).Initialize("BudgetPanel(1)")
        BudgetTable(i).Initialize(Me, "BudgetTable(1)", NumberOfColumns)
I saw that you don't use it so you can initialize directly with
BudgetTable(i).Initialize(Me, "", NumberOfColumns)
without all the Case instructions.
I don't think that events with an index like BudgetTable(1)_Click would work.
In your case there is no problem because you don't use it and the event name just remains as a string.

Best regards.
 
Upvote 0

fdx12345

Active Member
Licensed User
Longtime User
BudgetTable(1)_Click

Nope, that does not work. I just modified the Table Class to go were I wanted it to go on a click.

I will look at the other points. I was trying to follow examples as closely as follows to cut down errors as I was stressing things enough with indexing by itself.

Did you find out what may be hiding that last row?
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Change this line:
B4X:
Activity.AddView(BudgetPanel(i), 0, 230dip, 100%x, 50%y)
with this line:
B4X:
Activity.AddView(BudgetPanel(i), 0, 230dip, 100%x, 40%y)

Also, change this line:
B4X:
BudgetTable(i).AddToActivity(BudgetPanel(i), 0, 0, BudgetPanel(i).Width, BudgetPanel(i).Height)
with this line:
B4X:
BudgetTable(i).AddToActivity(BudgetPanel(i), 0, 0, BudgetPanel(i).Width, BudgetPanel(i).Height-10dip)

You should be able to scroll all your entries. I had similar issues with table class where I had to tweak the heights.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
After Mahars' post I made some more trials and with the code below it works:
B4X:
Activity.Title="Stand By Loading...."
Activity.AddView(BudgetPanel(i), 0, 230dip, 100%x, 100%y - 220dip)
BudgetPanel(i).Visible=False
BudgetTable(i).AddToActivity(BudgetPanel(i), 0, 0, 100%x, 100%y - 275dip)
But anyway with removing the double initialization and adding it would have solved the problem too. I still recommend you doing it.

Best regards.
 
Last edited:
Upvote 0

fdx12345

Active Member
Licensed User
Longtime User
sneaky!!!!!!!

Never thought about handling the bottom with a 100%y - 220dip. I need to work though my head exactly what is being done.

Is 100%y the maximum size from top of the phone screen to the bottom? If so then one is subtracting maximum vertical screen size by 220dip in leu of posting the result of the subtraction ie 220dip.

I am trying to figure out why it works with a y-dip format and not a single value (dip). The examples all use a single value and not a y-dip.

Thank you for your help.
 
Upvote 0
Top