B4A Library [Class] Flexible Table

Micholl

Member
Licensed User
Longtime User
Did I miss something? Something changed?
I'm using Nexus 7 Android 5.1.1 and B4A 5.02 (1).
The example from TableV1_43 crashes after a swipe gesture from right to left on the first table.

Getting: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.setAlpha(int)' on a null object reference.

Any hint, help or suggestion really appreciated .

Michael

B4X:
Connected to B4A-Bridge (Wi~e:java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.setAlpha(int)' on a null object reference
   at flm.b4a.scrollview2d.EdgeEffect.draw(EdgeEffect.java:320)
   at flm.b4a.scrollview2d.TwoDScrollView.draw(TwoDScrollView.java:1984)
   at android.view.View.updateDisplayListIfDirty(View.java:14167)
   at android.view.View.getDisplayList(View.java:14189)
   at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
   at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
   at android.view.View.updateDisplayListIfDirty(View.java:14127)
   at android.view.View.getDisplayList(View.java:14189)
   at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
   at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
   at android.view.View.updateDisplayListIfDirty(View.java:14127)
   at android.view.View.getDisplayList(View.java:14189)
   at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
   at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
   at android.view.View.updateDisplayListIfDirty(View.java:14127)
   at android.view.View.getDisplayList(View.java:14189)
   at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
   at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
   at android.view.View.updateDisplayListIfDirty(View.java:14127)
   at android.view.View.getDisplayList(View.java:14189)
   at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
   at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
   at android.view.View.updateDisplayListIfDirty(View.java:14127)
   at android.view.View.getDisplayList(View.java:14189)
   at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
   at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
   at android.view.View.updateDisplayListIfDirty(View.java:14127)
   at android.view.View.getDisplayList(View.java:14189)
   at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:273)
   at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:279)
   at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:318)
   at android.view.ViewRootImpl.draw(ViewRootImpl.java:2530)
   at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2352)
   at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1982)
   at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061)
   at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5885)
   at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
   at android.view.Choreographer.doCallbacks(Choreographer.java:580)
   at android.view.Choreographer.doFrame(Choreographer.java:550)
   at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
   at android.os.Handler.handleCallback(Handler.java:739)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:135)
   at android.app.ActivityThread.main(ActivityThread.java:5254)
   at java.lang.reflect.Method.invoke(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:372)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Connected to B4A-Bridge (Wifi)
sending message to waiting queue (CallSubDelayed - UpdateStatus)
Ignoring event (too many queued events: CallSubDelayed - UpdateStatus)
 

Micholl

Member
Licensed User
Longtime User
Obviously it's a problem with my version of ScrollView2D.
Library version *with* error is:

B4X:
<version>2.2</version>
<author>Fr\u00e9d\u00e9ric Leneuf-Magaud</author>

Maybe I got this one with ULV - UltimateListView.
Latest version from libs thread running *without* error seems to be this:

B4X:
<version>1.1</version>
<comment>ScrollView2D = HorizontalScrollView + VerticalScrollView</comment>
<author>Fr\u00e9d\u00e9ric Leneuf-Magaud</author>

I think I should ask Informatix about this.

So for the Moment the problem is SOLVED - thank you for checking!

Michael
 

Marlin Snyder

New Member
Licensed User
Longtime User
If this is not the right place for this question, I apologize, and if you can direct me to the appropriate place, I'll move there.

I use a non-standard (not relational, not normalized) database system, that we have successfully been able to connect to, and we are able to return data to load spinners with single columns of data. Once we make selections with those spinners to narrow down the focus, I can run a query and return several pertinent rows of data to my app, and I can concatenate the columns to fill a listbox control. I would really like to be able to use this Flexible Table or other grid component to accept the data I am already retrieving from the database.

In the included ZIP file, I'm setting up the TAGS variable as a list object (line 193, 194) then grabbing the data from the map and displaying it in the ListViews (lines 195-221).

Any assistance on getting this data into a grid or table object would be appreciated.

Thank you very much for the support in these forums.

Sincerely,

mksnyder
 

Attachments

  • HH.zip
    73.5 KB · Views: 223

stevel05

Expert
Licensed User
Longtime User
I have just started to use this class for a project, flexible table is definitely the right name for it. It works nicely and copes with a large amount of data very well. A great and very useful implementation.

I have found a small issue in that if you change the text size or colour after having added the table to a view, but before filling it, the cached labels are not updated. So only newly created labels have the required properties.

I apologize if this has been covered, I did look through the very large thread, but did not find anything related.
 

Jay Young

Member
Licensed User
Longtime User
how do you pull the data out of the Table1.GetValues(Row)

My code is:
todayALL = Table1.GetValues(Row)
it shows the values from the selected row just wondering how i get those values out to other variables
 

klaus

Expert
Licensed User
Longtime User
@Marlin Snyder
Here you are.
As promised a week ago I had a look at your problem.
Attached a modified project with the Flexible Table.
You can remove the two ListViews TreatmentHeader and Treatment.
 

Attachments

  • HH1.zip
    91 KB · Views: 224

Marlin Snyder

New Member
Licensed User
Longtime User
@Marlin Snyder
Here you are.
As promised a week ago I had a look at your problem.
Attached a modified project with the Flexible Table.
You can remove the two ListViews TreatmentHeader and Treatment.
@klaus Thank you VERY much! This is working, I'll look over the code and see how it is implemented, and make any necessary modifications. I appreciate the assistance.
 

Roberto P.

Well-Known Member
Licensed User
Longtime User
Hello
you can make too much text in a column to wrap automatically, without being cut off?

 

Roberto P.

Well-Known Member
Licensed User
Longtime User
I set the size of the width of columns

SetColumnsWidths(Array As Int(100, 170, 100, 140,250,300, 300, 80, 60, 300, 400, 140, 50, 52, 200, 150, 57, 58, 100, 140, 90, 52, 150, 54, 150, 100, 200, 58))

I did not set the alignment of cells
thanks
 

Roberto P.

Well-Known Member
Licensed User
Longtime User
I found it was set mTableAttivita.SingleLine = False
now it works correctly.
thank you
 

Roberto P.

Well-Known Member
Licensed User
Longtime User
I have another question for this nice component.
upright bar appears above the header and I can not take off, can anyone help me?



thank you
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…