Other [ABMaterial][POLL]Remove row from ABMTable

alwaysbusy

Expert
Licensed User
Longtime User
In one of the feedback cases, someone asked for a method to remove a row from an ABMTable. I've looked into if I want to add such a method, it has a big impact on the existing workings of the component.

Everything row related, would need to be done with the 'uniqueId as String' instead of 'row as int', which is a sequential increasing number used in the HTML id of the tag. Changes needed:

UseCellTheme(UniqueId as String, Column as Integer, ThemeName as String)
GetCellTheme(UniqueId as String, Column as Integer) as String
SetCellTag(UniqueId as String, Column as Integer, Tag as Object)
GetCellTag(UniqueId as String, Column as Integer) as Object
GetComponent(UniqueId as String, String componentId) as ABMComponent
SetString(UniqueId as String, Column as Integer, Value as String)
GetString(UniqueId as String, Column as Integer) as String

ABMTableCell as used in event Table_Clicked(PassedRowsAndColumns As List) would as result not have a row index, but a row 'Uniqueid':

e.g.

B4X:
Sub tblKlanten_Clicked(PassedRowsAndColumns As List)
    If page.IsBlockedEvent("tblKlanten") Then Return
    page.BlockEvent("tblKlanten")
  
    Dim tblCellInfo As ABMTableCell = PassedRowsAndColumns.Get(0)
    If tblCellInfo.Column = 1 Then
        page.Pause
  
        Dim tblKlanten As ABMTable = page.Component(tblCellInfo.TableName)
  
        ActiveContactId = tblKlanten.GetString(tblCellInfo.UniqueId, 0) ' <------------
        CallSubDelayed(Me, "SearchInfo")
    Else
      
        page.UnblockEvent("tblKlanten")      
    End If
End Sub

I know some people have created projects that make intensive use of the ABMTable component. But it is the only way to implementing such a 'remove' method. So fill in the poll: are you okay with such a change? I will only change it if the poll shows a HUGE in favour.
 
Last edited:

Harris

Expert
Licensed User
Longtime User
When I alter a row after an edit (or delete) I shall commonly refresh the page. It is not easy in a one-to-many relation grid layout, but it never is (to keep the same position) - especially on delete. Generally, I end up on page 1 - letting the user select whatever from there... (this is much easier than anything else I have tried).

You are the master of this domain and shall sauce it out for us.
 
Upvote 0
Top