I'm blowing the dust off an old app and updating from version 1.33 to version 3.09 of the table class.
I've now added the Table in the designer, instead of through code and modified my code but I get an error as follows:
This was the code I used for Version 1.33 and this still works with V1.33:
And this is the modified code for V3.09 (with Table added in designer)
What have I missed out in either correctly implementing or initializing?
I've now added the Table in the designer, instead of through code and modified my code but I get an error as follows:
logs:
--------- beginning of main
Copying updated assets files (43)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 498 (Table)
java.lang.RuntimeException: Object should first be initialized (Panel).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.ViewWrapper.setTag(ViewWrapper.java:255)
at com.dcpdata.exp.table._inittable(table.java:1149)
at com.dcpdata.exp.table._initialize(table.java:3518)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:61)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:134)
at anywheresoftware.b4a.objects.TabStripViewPager.LoadLayout(TabStripViewPager.java:116)
at com.dcpdata.exp.main._activity_create(main.java:579)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at com.dcpdata.exp.main.afterFirstLayout(main.java:104)
at com.dcpdata.exp.main.access$000(main.java:17)
at com.dcpdata.exp.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7811)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
Current page: 0
** Activity (main) Resume **
This was the code I used for Version 1.33 and this still works with V1.33:
Old V1.33 code:
Table1.Initialize (Me, "Table1", 3, Gravity.CENTER, False)
Table1.AddToActivity(PanelTab, 0dip, 0dip, 150dip, 380dip)
Table1.HeaderColor = Colors.LightGray
Table1.HeaderTextColor = Colors.Black
Table1.TextSize = 12
Table1.SetHeader(Array As String("Blows", "Total blows", "Pen"))
Table1.SetColumnsWidths (Array As Int (50dip, 50dip, 50dip))
And this is the modified code for V3.09 (with Table added in designer)
New code V3.09:
Table1.SetColumnsWidths(Array As Int(50dip, 50dip, 50dip))
Table1.SetHeader(Array As String("Blows", "Total blows", "Pen"))
What have I missed out in either correctly implementing or initializing?
Last edited: