B4J Question 【abmaterial】(about extrasidebar) the event doesn't be raised

liulifeng77

Active Member
Licensed User
hi,
I build a abmtable on the extrasidebar, and build abmcheckbox component in the table.
but all clicked event doesn't raised.
B4X:
Dim sb As ABMSideBar = page.GetSidebar("extrasidebar")
    sb.Content.AddRows(3,True,"").AddCells12(1,"")
    sb.Content.BuildGrid
    Dim table_control As ABMTable
    table_control.InitializeScrollable(page,"table_control",False,False,True,Array As Int(side_width,side_width,side_width,side_width),"")
    table_control.SetHeaders(Array As String("id","name","ask","show"))
     sb.Content.Cell(1,1).AddComponent(table_control)

B4X:
Dim sb As ABMSideBar = page.GetSidebar("extrasidebar")
        Dim table_control As ABMTable=sb.Content.Component("table_control")
        Dim ask_all As ABMCheckbox
        ask_all.Initialize(page,"ask_all","all",True,"")
        Dim show_all As ABMCheckbox
        show_all.Initialize(page,"show_all","all",True,"")
        table_control.AddRow("firs_line",Array As Object("","",ask_all,show_all))

B4X:
Sub table_control_clicked(PassedRowsAndColumns As List)
Dim tblCellInfo As ABMTableCell = PassedRowsAndColumns.Get(0)
Dim sidebar As ABMSideBar=page.GetSideBar("extrasidebar")

Dim table As ABMTable=sidebar.Content.Component("table_control")

Dim message=table.GetString(tblCellInfo.Row,3)

Log(message)

End Sub
B4X:
Sub ask_all_clicked(target As String)
    Log(target)
End Sub
Sub show_all_clicked(target As String)
Log(target) 
End Sub

all events not response!
any suggestion,thanks!


add:I add a abmlist on the extrasidebar, clicked event be raised.
maybe it is abmtable component's bug!
 
Last edited:

Harris

Expert
Licensed User
Log the events in Page_ParseEvent to see what is being processed....

B4X:
Sub Page_ParseEvent(Params As Map)

    '  Very Helpful to log control clicks and discover what params are required - and such !!!!
    Log(" *** Page Event name: "&eventName&"  Params: "&Params) ' this is used to see what component was clicked and what the parameters are...
 
Upvote 0

liulifeng77

Active Member
Licensed User
thanks for your replying!

table_clicked event raised.
log:table_control_clicked
(MyMap) {eventparams=abmistable,target, abmistable=abmistable, eventname=table_control_clicked, target=extrasidebarcontent-table_control_4_2__}


but can't get any information of table.It's empty.
B4X:
Dim tblCellInfo As ABMTableCell = PassedRowsAndColumns.Get(0)
Dim sb As ABMSideBar = page.GetSidebar("extrasidebar")

Dim tb As ABMTable=sb.Content.cell(1,1).Component("table_control")

Dim message As String=tb.getstring(tblCellInfo.Row,0)

Log("message"&message)

abmcheckbox still not be raised!
 
Upvote 0

Harris

Expert
Licensed User
Not enough information here... I see you getting the sidebar, but not where you built it!
Please Post the entire page code so we can see how you constructed this.
Thanks
 
Upvote 0

liulifeng77

Active Member
Licensed User
here is the code:
B4X:
Public Sub BuildExtraSideBar(Page As ABMPage,width As Int,topstart As Int) As ABMSideBar
    Dim extraSideBar As ABMSideBar
    'extraSideBar.InitializeAsPanel(Page, "extrasidebar", width,topstart, Null, "", "extrasidebarcontent", "")
    extraSideBar.InitializeResponsiveAsPanel(Page,"extrasidebar",width,width,width,topstart,Null,"","extrasidebarcontent","")
    extraSideBar.Content.AddRowsM(1, False, 0, 0, "").AddCells12MP(1,0,0,0,0,"")
    extraSideBar.Content.BuildGrid
        Return extraSideBar
End Sub

B4X:
Sub ConnectPage()
......
page.NavigationBar.AddTopItemWithSideBar("extrasidebar", "", "mdi-communication-message", "", ABM.VISIBILITY_ALL, ABMShared.BuildExtraSideBar(page,width, 56))
End sub

thanks!!
 
Upvote 0
Top