B4J Question [ABMaterial] TimeoutException

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi

I copy some code showing abmtable(as following picture) from demo project. the ide always has a exception as following code when abmtable is showing some seconds later. Why ..!? Do I have missing anything !? :confused::mad:o_O:eek:

B4X:
Sub Page_Ready()              
    ConnectPage   
End Sub

Sub ConnectPage()
    'NEW
    ABMShared.ConnectNavigationBar(page)
   
    FirstNames.Initialize2(Array As String("Alain", "Jos", "Paul", "Bertrande", "Julie", "Stephanie", "Bert", "Charles", "James", "Walter"))
    LastNames.Initialize2(Array As String("Bailleul", "Rogiers", "Dougherty", "Rodrigues", "Ostrander", "Kenyon", "Grant", "Klinger", "Sheffield", "Poindexter"))
   
    ' add paragraph   
    page.Cell(1,1).AddComponent(ABMShared.BuildParagraphBQ(page,"par1b", "The Id of a table {B}MAY NOT CONTAIN A _ CHARACTER!{/B}.  This is because of the inner working of nested table and the _ character is reserved.") )
   
    ' create a table
    Dim tbl1 As ABMTable
    tbl1.Initialize(page, "tbl1", False, False, True, "tbl1theme")
    tbl1.SetHeaders(Array As String("First Name", "Last Name", "Sales Profit"))
    tbl1.SetColumnDataFields(Array As String("FirstName", "LastName", "SalesProfit"))
    tbl1.SetHeaderThemes(Array As String("headerfooter", "headerfooter", "headerfooterright"))
   
    ' add some random values
    For i = 0 To 9
        Dim r As List
        Dim rCellThemes As List
        r.Initialize
        rCellThemes.Initialize
        r.Add(FirstNames.get(Rnd(0,9)))
        rCellThemes.Add("nocolor") ' nocoloredit
        r.Add(LastNames.get(Rnd(0,9)))
        rCellThemes.Add("nocolor")       
        Dim Neg As Int = Rnd(0,100)
        If Neg > 50 Then
            r.Add("$" & Rnd(1000, 15000))
            rCellThemes.Add("positive")
        Else
            r.Add("$-" & Rnd(1000, 15000))
            rCellThemes.Add("negative")
        End If
        tbl1.AddRow("uid" & i, r)
        tbl1.SetRowThemes(rCellThemes) ' make sure you have as many items in rCellThemes as in r!
    Next
   
    tbl1.SetFooter("This is a footer that appears on the bottom of the table.", 12,"headerfooter")
   
    page.Cell(2,1).AddComponent(tbl1)
   
    page.Refresh ' IMPORTANT
   
    ' NEW, because we use ShowLoaderType=ABM.LOADER_TYPE_MANUAL
    page.FinishedLoading 'IMPORTANT   
   
    page.RestoreNavigationBarPosition
End Sub

B4X:
WebSocket Disconnected
WebSocket Connected
Waiting for value (100 ms)
Waiting for value (100 ms)
java.util.concurrent.TimeoutException
    at anywheresoftware.b4j.object.WebSocket$SimpleFuture.getValue(WebSocket.java:63)
    at com.ab.abmaterial.ABMTable.GetActiveTableRow(Unknown Source)
    at com.ab.abmaterial.ABMTable.GetActiveRow(Unknown Source)
    at com.ab.abmaterial.ABMTable.RefreshInternal(Unknown Source)
    at com.ab.abmaterial.ABMTable.FirstRunInternal(Unknown Source)
    at com.ab.abmaterial.ABMCell.RefreshInternalExtra(Unknown Source)
    at com.ab.abmaterial.ABMRow.RefreshInternal(Unknown Source)
    at com.ab.abmaterial.ABMPage.Refresh(Unknown Source)
    at b4j.example.signalpage._connectpage(signalpage.java:512)
    at b4j.example.signalpage._page_ready(signalpage.java:662)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:612)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:229)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
    at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:462)
    at anywheresoftware.b4a.keywords.Common.CallSubNew(Common.java:409)
    at b4j.example.signalpage._page_parseevent(signalpage.java:617)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:612)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:229)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
    at anywheresoftware.b4j.object.WebSocketModule$Adapter$1.run(WebSocketModule.java:126)
    at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
    at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
    at anywheresoftware.b4a.ShellBA.startMessageLoop(ShellBA.java:111)
    at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:131)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:301)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
    at b4j.example.main.main(main.java:29)

46c0ca6517cb5d68996818def23afb3a.png
 

amminf

Active Member
Licensed User
Longtime User
Not because my intention is to reuse the same rCellThemes list in each line. Is it possible ?
 
Upvote 0

amminf

Active Member
Licensed User
Longtime User
OK thanks. My only intention was to improve the loading time of the table to avoid timeout.
 
Upvote 0

amminf

Active Member
Licensed User
Longtime User
All this has already been removed, because it seems that when a modalsheet is Dissmiss then it is not shown quickly when a showModalSheet is reinvoked.


B4X:
Else
     Dim cId As String = "inpSelectorClients"
     Dim myModal As ABMModalSheet = page.ModalSheet (cId)

     Page.ShowModalSheet (cId)
     MyModal.Refresh
     'Page.Refresh
End If
 
Upvote 0
Top