Hi All,
I am having problems trying to delete a row from an ABMTableMutable table/
Here is ConnectPage:-
And a simple button click event:-
When I click the button only the first line of the table shows:-
I am having problems trying to delete a row from an ABMTableMutable table/
Here is ConnectPage:-
B4X:
public Sub ConnectPage()
' connecting the navigation bar
' ABMShared.ConnectNavigationBar(page)
Dim lab As ABMLabel
Dim But1 As ABMButton
lab.Initialize(page,"lab","Button testing",ABM.SIZE_H5,False,"mytheme")
But1.InitializeRaised(page,"but1","","","Delete row 1","mytheme") ' FullWidth+SetBord
But1.UseFullCellWidth = True
Dim tbl As ABMTableMutable
tbl.Initialize(page,"tbl",False,False,False,"")
Dim rList As List
rList.Initialize
Dim tList As List
tList.Initialize
tList.Add("")
tList.Add("")
tList.Add("")
tbl.SetColumnWidths(Array As Int(100,20,15))
tbl.SetHeaders(Array As String ("Chemical","QuantDesc","Units"))
tbl.SetColumnVisible(Array As Boolean (True,True,True))
rList.Add("row0")
rList.Add("Col2")
rList.Add("Col3")
tbl.InsertRowAfter("","row0",rList,tList)
rList.Clear
rList.Add("row1")
rList.Add("Col2")
rList.Add("Col3")
tbl.InsertRowAfter("row0","row1",rList,tList)
rList.Clear
rList.Add("row2")
rList.Add("Col2")
rList.Add("Col3")
tbl.InsertRowAfter("row1","row2",rList,tList)
page.Cell(1,1).AddComponent(lab)
page.Cell(2,1).AddComponent(But1)
page.Cell(4,1).AddComponent(tbl)
' refresh the page
page.Refresh
' Tell the browser we finished loading
page.FinishedLoading
' restoring the navigation bar position
page.RestoreNavigationBarPosition
End Sub
And a simple button click event:-
B4X:
Sub but1_clicked(Tar As String)
Dim t As ABMTableMutable = page.Component("tbl")
t.RemoveRow("row1")
t.Refresh
End Sub
When I click the button only the first line of the table shows:-
What am I doing wrong?The log shows :- "Something is wrong with the sync of the table. Row is null!"