Android Question working witt data values in flexibletable

afields

Member
Licensed User
Hi to all.

my versions:
b4a 6.31
adp
table 2.1
i'm back again after trying to solve the problem that i've got: it was that with ADP and also a table (both created in design view) i cannot use the adp because it's like it is not there.
To fix ideias i had planned to make a test program (without the complexity of the real aplication ) just to see if i've got the same problem.
So i've created a simple layout (in design view) that has a table view and a adp view.
the table rows were not filled with sql data but directly.
however i did not make whatever test because the program gives always error messages with the table view. ( as you'll see )
so the program test had become even more simple with only a table view in the design view .
i thought that it was needed to write some proprertys of the table view in a particular order but always errors ( i must say that those error are not the same error but still all in the table view (it's the only view that i have)
my question:
- is table view just for work with data (from sql or csv files) and not directly?

thank you

test program ( with 1 table view in design view whose name is table1)

B4X:
Sub Activity_Create(FirstTime As Boolean)
    Private lista As List
    Activity.LoadLayout("1")
    table1.SetHeader(Array As String("Col1", "Col2", "Col3"))
    table1.SetColumnsWidths(Array As Int(50dip,50dip,50dip))
   
    lista.AddAll(Array As String("aaa", "ccc", "ddd"))
    lista.AddAll(Array As String("aaa", "ccc", "ddd"))
    table1.AddRow(lista.Get(0))
    table1.AddRow(lista.Get(1))

End Sub

and the error
B4X:
Error occurred on line: 432 (Table)
java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
    at b4a.example.table._setcolumnswidths(table.java:334)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:708)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:337)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
    at b4a.example.main.afterFirstLayout(main.java:102)
    at b4a.example.main.access$000(main.java:17)
    at b4a.example.main$WaitForLayout.run(main.java:80)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:5017)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
    at dalvik.system.NativeStart.main(Native Method)
** Activity (main) Resume **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
 

afields

Member
Licensed User
Strange! i would say that i have post a new message with the zip file. however i do not see it!!! well here it goes the zip file as yu've told me to do klaus
 

Attachments

  • teste.zip
    22.1 KB · Views: 203
Upvote 0

afields

Member
Licensed User
Attached you find a modified project.
I added NumberOfColumns as a property for the Designer in the table class.
Thanks Klaus for your super quicky answer. Now it work! and now i'm able to test why do anotherdatepicker not work when in release mode ( in debug it works).
thank you Klaus!
 
Upvote 0
Top