I have a method that checks to see if one or more rows of a iOSMobileTable is selected (to enable/disable buttons). It works if the selected Row is the second or subsequent Row, but… if the iOSMobileTable has none or the first Row selected, in both cases, the Pair is 0,0 so I am unable to properly confirm that a Row is selected or not. It would be better if the Pair returned -1,-1 if no Row was selected.
Var tempiOSMobileTable As iOSMobileTable = iOSMobileTable(myListBox)
Var Selection As Pair = tempiOSMobileTable.SelectedRow
Var Section As Integer = Selection.Left
Var Row As Integer = Selection.Right
Return If(Section >= 0 And Row >= 0, 1, 0) 'matches first or none
How can you determine if a Table Row is highlighted or not?
Would the SelectionChanged event not be good enough for your case?
Since you have a method that does that work now, perhaps this would fix it for you.
I agree that it the selection returns 0,0 always (on no selection) this is a bug. -1, -1 would be much more logical for such. I think it may even be better to have the properties/methods: .SelectedRowIndex(Section As Integer = -1) As Integer // Return the rowIndex (optionally based on index of section)
.SelectedSectionIndex As Integer // Returns the Section Index that’s currently selected
I’ve pratically never seens xojo used a Pair before on such property, not that it’s a problem it just seems uncommon (inconsistent).
This Event doesn’t fire after a Row is selected, then you perform a RemoveAllRows before a Refresh of the table data. I will have to manually disable the buttons after a Refresh.
Maybe some Xojo engineer has an alternative solution at hand?