Share My Creation [B4J] MagmaGRID - Next Generation B4XTable 0$

1756831277377.png


What is MAGMAGRID? 🧩


MAGMAGRID is the Next Generation B4XTable... The code for the start is only available to licensed members of the forum.


What can it do? 🔧
Features:

  • Column Resizing ↔
  • Hiding/Showing 👁️
  • Easy Add Column at Creation ➕
  • Easy Inline Editing ✏️
  • Easy Moving ⬍
  • Easy Column Calculation and Sum of Rows ∑
  • Easy Extract Data to List 📋
  • Even if at runtime the window resizes — and B4XTable has different visible rows/columns — it works fine when moving through lines and fields

For now, works only in B4J... but should be easy for B4A too (I think even easier with IME keyboard) 📱


What I expect from all users of Forum:
Add new features and post here their versions or fixes... to create a solid class 💪
Why I didn’t make it a B4XLib... I don’t think B4XTable needs an extra lib with the same features...


But we need to understand how it works and how it can be better 🔍

Uses: B4XTable, InlineEditing, B4XTableSelections, B4XEval

Also I would like to tag some persons that I am sure will help make it better (plz don;t stay at same name of class - you can change it as you want) - but plz post your solution or fix here...
@aeric @PaulMeuris @Mahares @stevel05 @mcqueccu @Mashiane @LucaMs @DonManfred @Alexander Stolte @Star-Dust @Filippo @Peter Simpson @EnriqueGonzalez @asales @Johan Hormaza @tchart @teddybear @TILogistic @JakeBullet70 @Erel

@everyone

ps: I am so sorry for asking (tag you) to add your tips... your ideas... but I believe that if we add from one line from anyone - will have the opportunity to have "business controls" that will help all for Fast Creation of Apps!


The code for the start is only available to licensed members of the forum
You can find it here: https://www.b4x.com/android/forum/t...xt-generation-b4xtable-0.168499/#post-1032789
 
Last edited:

aeric

Expert
Licensed User
Longtime User
Hi Magma, I suggest you create a GitHub repo so it is easier for anyone to make pull request and report issue.
 

Guenter Becker

Active Member
Licensed User
Hi,
I like to use also a Button in a Column. This button is only be used with a click event and icon by font awesome.
Could ypu please give me an snipped how to modify the AddColumn sub.
Tried it in the class code but got always the compiler error that "BUTTON" as type is no accepted type.

Thank you in advance
 

Magma

Expert
Licensed User
Longtime User
Hi,
I like to use also a Button in a Column. This button is only be used with a click event and icon by font awesome.
Could ypu please give me an snipped how to modify the AddColumn sub.
Tried it in the class code but got always the compiler error that "BUTTON" as type is no accepted type.

Thank you in advance
Check GitHub link at 1st post of link attached - for new version: https://www.b4x.com/android/forum/t...xt-generation-b4xtable-0.168499/#post-1032789

Search with your name - and will see the example...

I think callsub is very helpful for this situation... you can do many things !
 

Guenter Becker

Active Member
Licensed User
Ok got it thank you for quick response. I checked it and found we are close to the end. Why?
it works if the button is added as last column.
Moving the AddColumn (Button) up to an other position:

Button as 1st column -example-:
    mg.Initialize(Pane1)
    mg.AddColumn("ShowMoves",  False, True , False,80,"BUTTON","Show Moves...", Array As Object(Me,"showmoves","rowid"),0,0,0,"CENTER",  0, 0, 0, False) 'Asked by Guenter Becker (Anything is different from changing values - must be added as VOID and in DataUpdated) / same for images too
    mg.AddColumn("ID",False,True,True,70,"TEXTFIELD_NUMERIC","",Null, 0,0,0,"CENTER", 5, 0, 0, False)
.....

except the last one like as the 1st column this error is thrown:
LastException:
Waiting for debugger to connect...
Program started.
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
Error occurred on line: 171 (MagmaGrid)
java.util.NoSuchElementException
    at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:766)
    at java.base/java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:796)
    at java.base/java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:794)
    at anywheresoftware.b4a.objects.collections.Map$MyMap.getEntry(Map.java:234)
    at anywheresoftware.b4a.objects.collections.Map$MyMap.getValue(Map.java:223)
    at anywheresoftware.b4a.objects.collections.Map.GetValueAt(Map.java:130)
    at b4j.example.magmagrid._setvalue(magmagrid.java:2486)
    at b4j.example.magmagrid._rowcalcpraxis(magmagrid.java:1228)
    at b4j.example.magmagrid._calcall(magmagrid.java:420)
    at b4j.example.magmagrid$ResumableSub_SetData.resume(magmagrid.java:291)
    at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:47)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
    at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:42)
    at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:156)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:105)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
    at anywheresoftware.b4a.keywords.Common$3.run(Common.java:1172)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
    at java.base/java.lang.Thread.run(Thread.java:1589)

Don'nt know why. The goal is to put the buutton at any column position.
Any Idea whats goint wrong?
 

Magma

Expert
Licensed User
Longtime User
Ok got it thank you for quick response. I checked it and found we are close to the end. Why?
it works if the button is added as last column.
Moving the AddColumn (Button) up to an other position:

Button as 1st column -example-:
    mg.Initialize(Pane1)
    mg.AddColumn("ShowMoves",  False, True , False,80,"BUTTON","Show Moves...", Array As Object(Me,"showmoves","rowid"),0,0,0,"CENTER",  0, 0, 0, False) 'Asked by Guenter Becker (Anything is different from changing values - must be added as VOID and in DataUpdated) / same for images too
    mg.AddColumn("ID",False,True,True,70,"TEXTFIELD_NUMERIC","",Null, 0,0,0,"CENTER", 5, 0, 0, False)
.....

except the last one like as the 1st column this error is thrown:
LastException:
Waiting for debugger to connect...
Program started.
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
Error occurred on line: 171 (MagmaGrid)
java.util.NoSuchElementException
    at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:766)
    at java.base/java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:796)
    at java.base/java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:794)
    at anywheresoftware.b4a.objects.collections.Map$MyMap.getEntry(Map.java:234)
    at anywheresoftware.b4a.objects.collections.Map$MyMap.getValue(Map.java:223)
    at anywheresoftware.b4a.objects.collections.Map.GetValueAt(Map.java:130)
    at b4j.example.magmagrid._setvalue(magmagrid.java:2486)
    at b4j.example.magmagrid._rowcalcpraxis(magmagrid.java:1228)
    at b4j.example.magmagrid._calcall(magmagrid.java:420)
    at b4j.example.magmagrid$ResumableSub_SetData.resume(magmagrid.java:291)
    at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:47)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
    at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:42)
    at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:156)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:105)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
    at anywheresoftware.b4a.keywords.Common$3.run(Common.java:1172)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
    at java.base/java.lang.Thread.run(Thread.java:1589)

Don'nt know why. The goal is to put the buutton at any column position.
Any Idea whats goint wrong?
 

Magma

Expert
Licensed User
Longtime User
Top