I am using the Table.bas module as per the example.
Here is my Main routine:
I know my data is right and the routine does not give me an error.
I get this error in Tables.bas:
What could be the problem?
Thanks
PK
Here is my Main routine:
Main:
public Sub GetMessagesSent
DateTime.DateFormat = "dd-MMM-yy"
Dim req As DBRequestManager = CreateRequest
Dim cmd As DBcommand = CreateCommand("showsentmessages", Array(AndroidID))
Dim ColWidths(5) As Int
Table1.ClearAll
Table1.SetHeader(Array As String("Date","Message","Remarks","Solved","ID"))
ColWidths(0)=55dip
ColWidths(1)=260dip
ColWidths(2)=0dip
ColWidths(3)=0dip
ColWidths(4)=50dip
Table1.SetColumnsWidths(ColWidths)
Table1.RowHeight=60dip
Table1.SingleLine = False
Wait For (req.ExecuteQuery(cmd, 0, AndroidID)) JobDone(j As HttpJob)
If j.Success Then
req.HandleJobAsync(j, "req")
Wait For (req) req_Result(res As DBresult)
Dim Alignments(5) As Int
Alignments = Array As Int(Bit.Or(Gravity.LEFT, Gravity.CENTER_VERTICAL), Bit.Or(Gravity.LEFT, Gravity.CENTER_VERTICAL), Bit.Or(Gravity.LEFT, Gravity.CENTER_VERTICAL), Bit.Or(Gravity.CENTER, Gravity.CENTER_VERTICAL), Bit.Or(Gravity.CENTER, Gravity.CENTER_VERTICAL))
Table1.SetCellAlignments(Alignments)
If res.Rows.Size > 0 Then
'Dim Row(5) As String
For i = 1 To res.Rows.Size-1
Dim Row() As Object =Array(res.Columns.Get(0),res.Columns.Get(1) & Chr(10) & "Reply: " & res.Columns.Get(2),res.Columns.Get(2),res.Columns.Get(3),res.Columns.Get(4)) ' = Array("DateTime","Message","Remark","Resolved","ID")
Table1.addRow(Row)
Next
pnlTables.Visible = True
Else
lblMessage.text = "No messages sent to office were fetched."
pnlTables.Visible = False
Table1.visible = False
End If
Else
Log("ERROR: " & j.ErrorMessage)
End If
j.release
CallSubDelayed(Me, "resGetMessagesSent_Complete")
End Sub
I know my data is right and the routine does not give me an error.
I get this error in Tables.bas:
Error occurred on line: 1130 (Table)
java.lang.IllegalArgumentException: method pk.odendaalNew.table._addrow argument 2 has type java.lang.String[], got java.lang.Object[]
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.raiseEvent(BA.java:193)
at anywheresoftware.b4a.shell.DebugResumableSub$RemoteResumableSub.resume(DebugResumableSub.java:22)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:137)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
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:8016)
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)
What could be the problem?
Thanks
PK