Sub rep_Clicked(PassedRowsAndColumns As List)
' is the root table
Dim cell_idcliente As ABMTableCell = PassedRowsAndColumns.Get(0)
end sub
tbldetl.Initialize(page, "tbldetl", False, True, True, "tbltheme")
tbldetl.SetHeaders( Array As String( "ITEM ID" ,"Grp","Detail Name", "Help / Description" , "Type", "Edit " ,"Delete" ))
tbldetl.SetHeaderThemes( Array As String( "bgb" , "bgc", "bgc" , "bgc" , "bgc" , "bgc" ,"bgc" ))
tbldetl.SetColumnVisible( Array As Boolean( True, False , True, True, False, True ,True ))
Sub tbldetl_clicked(PassedRowsAndColumns As List)
Dim tblCellInfo As ABMTableCell = PassedRowsAndColumns.Get(0) ' there is only 1 item in this list - hence Get(0)
Dim tblCases As ABMTable = page.Component(tblCellInfo.TableName) ' let's get the ABMtable from the page by getting the cellinfo table name
SelectedRowId = tblCases.GetString(tblCellInfo.Row, 4) ' from the row that was selected - get the value of column 4
'Dim zonenum = tblCases.GetString(tblCellInfo.Row, 1) ' we could also get the value from column 1 - if we wanted to...
' we placed buttons in col 5 & 6 of this table
' was either one of the buttons pressed as part of selecting this table row???
If tblCellInfo.Column = 6 Or tblCellInfo.Column = 5 Then ' edit / delete
If Mastcomp = "0" Then
Toast(" MASTER TEMPLATE - Make A New Inspection to Modify!",5000)
Return
End If
If tblCellInfo.Column = 5 Then
ABMGentiInsp_deTEdit(SelectedRowId) ' this will call the modal sheet so we may edit values...
' Toast("edit this item: "&SelectedRowId,3000)
End If
If tblCellInfo.Column = 6 Then
ABMGentiInsp_deTDelete(SelectedRowId)
' Toast("delete this item: "&SelectedRowId,3000)
End If
End If
End Sub
This is how I do, and get an empty string, that really work for You?. Maybe I need to get the instance of the table, and NOT just use my global table variable?I aso tried this, it suppose to get the value of (row,column), but I only get an empty string.
Rep is the ABMTable
B4X:nombre = rep.GetString(cell_idcliente.row,1)
Sub tbldetl_clicked(PassedRowsAndColumns As List)
Dim tblCellInfo As ABMTableCell = PassedRowsAndColumns.Get(0) ' there is only 1 item in this list - hence Get(0)
Dim tblCases As ABMTable = page.Component(tblCellInfo.TableName) ' let's get the ABMtable from the page by getting the cellinfo table name
SelectedRowId = tblCases.GetString(tblCellInfo.Row, 4) ' from the row that was selected - get the value of column 4
'Dim zonenum = tblCases.GetString(tblCellInfo.Row, 1) ' we could also get the value from column 1 - if we wanted to...
This IS the relevant code, rep is the ABMTable, it does not throw an error, but returns ALWAYS an empty string, that's why I asked You, if You really test that code and really works for You?That's my example code - where is yours? We have no idea what you are trying to accomplish...
Post the code from the entire page you are working with, or Export (project) as Zip...
Thanks
Sub rep_Clicked(PassedRowsAndColumns As List)
' is the root table
Dim cell_idcliente As ABMTableCell = PassedRowsAndColumns.Get(0)
' Dim cell_nombre_cliente As ABMTableCell = PassedRowsAndColumns.Get(1)
'idrepartidor = repar_lista.Get(cell_idcliente.Row)
Dim s As ABMModalSheet
s = page.ModalSheet("fixedsheet")
Dim tblClientes As ABMTable = s.Content.Component("rep")
'idrepartidor = tblClientes.GetString(cell_idcliente.row,0)
nombre = tblClientes.GetString(cell_idcliente.row,1)
End Sub
Sub rep_Clicked(PassedRowsAndColumns As List)
Dim cell_idcliente As ABMTableCell = PassedRowsAndColumns.Get(0)
Dim tblClientes As ABMTable = page.Component(tblCellInfo.TableName)
nombre = tblClientes.GetString(cell_idcliente.row, 1)
Log(" What is number returned: "&nombre&" <--- returned anything?")
End Sub
exactly....What Harris means is that you are doing something different that IS NOT shown here in the small snippets you give us to analyze. e.g. it appears to be on a modalsheet not directly on a page (different from the code from Harris, so maybe this has an influence), so how does your creation of the table look like could be helpful. How do you fill the table can help so we don't have to guess what values are in each column. A screenshot of the filled table can help. What is the value of cell_idcliente.row can help.
Ok! Got it now, I create the table in a fixedsheet like widget. rep is global variable ABMTable. So I initialize at creation of the sheet. Below is the complete code.What Harris means is that you are doing something different that IS NOT shown here in the small snippets you give us to analyze. e.g. it appears to be on a modalsheet not directly on a page (different from the code from Harris, so maybe this has an influence), so how does your creation of the table look like could be helpful. How do you fill the table can help so we don't have to guess what values are in each column. A screenshot of the filled table can help. What is the value of cell_idcliente.row can help.
Sub BuildFixedFooterSheet() As ABMModalSheet
Dim myModal As ABMModalSheet
myModal.Initialize(page, "fixedsheet", True, False, "")
myModal.Size = ABM.MODALSHEET_SIZE_LARGE
myModal.Content.UseTheme("modalcontent")
myModal.Footer.UseTheme("modalfooter")
myModal.IsDismissible = False
myModal.Content.AddRows(1,True, "").AddCells12(1,"centre")
' myModal.Content.AddRows(1,True, "").AddCellsOS(2,0,0,0,6,6,6,"")
' myModal.Content.AddRows(5,True, "").AddCells12(1,"")
myModal.Content.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
' create the grid for the footer
' we add a row without the default 20px padding so we need to use AddRowsM().
myModal.Footer.AddRowsM(1,True,0,0, "").AddCellsOS(1,6,6,6,3,3,3,"").AddCellsOS(1,0,0,0,3,3,3, "")
myModal.Footer.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
'crear la tabla con los datos de los repartidores.
rep.Initialize(page,"rep",True,False,True,"")
rep.SetColumnWidths(Array As Int(75, 200))
rep.IsScrollable = True
'repartidores.InitializeScrollable(page, "repartidores", True, False, True, Array As Int(75, 300,200,150), "tbl1theme")
rep.SetHeaders(Array As String("ID","Nombre"))',"Cant. Repartos"))
rep.SetColumnDataFields(Array As String("idrepartidor", "nombre"))
myModal.Content.Cell(1,1).AddComponent(rep)
' create the buttons for the footer
Dim btn_aceptar As ABMButton
btn_aceptar.InitializeFlat(page, "btn_aceptar", "", "", "Aceptar", "transparent")
btn_aceptar.Tag = "aceptar"
Dim btn_cancelar As ABMButton
btn_cancelar.InitializeFlat(page, "btn_cancelar", "", "", "Cancelar", "transparent")
myModal.Footer.Cell(1,2).AddComponent(btn_cancelar)
myModal.Footer.Cell(1,1).AddComponent(btn_aceptar)
Return myModal
End Sub
Correct...Well I use label objects to insert each column in the row. So I thing getstring won't work?
that is it. No, getstring does not work if you use other ABM components (because it can be anything, an ABMImage, an ABMButton, ...). You first have to grab the ABMLabel using getcomponent() and then take the .text property. If nothing special is needed of the label, it is much easier to just fill it with the string instead of a label. Then you can use getstring.Well I use label objects to insert each column in the row. So I thing getstring won't work?
Yes! Anyway, is good that I could find an answer, I will use a component and get the text. Thanks so much for Your time and Harris's time hehethat is it. No, getstring does not work if you use other ABM components (because it can be anything, an ABMImage, an ABMButton, ...). You first have to grab the ABMLabel using getcomponent() and then take the .text property. If nothing special is needed in the the label, it is much easier to just fill it with the string instead of a label. Then you can use getstring.
you will also have to make sure every label has a unique id to do this. It is probably a lot easier to use just strings.