B4J Question [abmaterial]can't get abmtablecell.RowUniqueid

liulifeng77

Active Member
Licensed User
Longtime User
may be it's a bug? wish you help? thanks!
B4X:
tblmaterial.AddRow("1", rCellValues)

.........



Sub tblmaterial_Clicked(PassedRowsAndColumns As List)
    
    ' fill with the active values
    Dim tblCellInfo As ABMTableCell = PassedRowsAndColumns.Get(0)
    Dim tblmaterial As ABMTable = page.Component(tblCellInfo.TableName)
    Log(tblCellInfo.RowUniqueId)
end sub
 

Philip Chatzigeorgiadis

Active Member
Licensed User
Longtime User
Sometimes I also face similar problems - clicking on an ABMTable and not getting back information.
Usually, the problem goes away if I run my program in Debug mode.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
Is that not a B4JS thing? I often use a map as the tag whenever possible.
Having said that, I have found an ABM control where the tag only accepted a string rather than an object.... Probably an oversite in creation...
 
Last edited:
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
Upvote 0

Harris

Expert
Licensed User
Longtime User
RowUniqueID is only available for an ABMTableMutable, not for ABMTable. As ABMTable is not 'changeable', the rows are in the order you added them. so get get back RowId as an int, not a RowUniqueID. Is historically grown as ABMTableMutable did not exist at first and I did not want to break code.

see example usage: https://www.b4x.com/android/forum/t...e-delete-a-row-in-abmtable.83378/#post-528109
So, with this explained (again - how quickly we forget).... use the primary key of your record (MySQL), in the first cell as your row (record) ID.
I do this with every ABMTable that derives its' content from a database table and see no reason not to do so (how else?).

In the rare instance where I need to build a table based on a compilation of many other datasets (associated tables) - (temp disk or in-memory), I always create a Primary Key to deal with the selected record. Otherwise, how can one determine what specific data you are referencing?

Unless you provide a specific example of what you are trying to accomplish, no one will take the time to "mind read" what is the issue.

As a caveat and sympathetic , I don't use ABMTables without an underlying data table. I know these uses exist, just I am not familiar. Perhaps someone can shed some light on what I am sorely missing, as it may be extremely useful moving forward.
Thanks
 
Upvote 0
Top