Mikelgiles Active Member Licensed User Longtime User Apr 18, 2017 #1 I need to know the selected cell or selected column on a tableview. I have looked extensively in the forum and have not found a answer. I know that B4J always knows the SelectedRow and that the selected cell can get highlited so I visually know what column (cell) is selected. But I need code that will tell me what column is selected. I thought maybe .SelectedColumn but if so I have not found it. Is there any simple way to get it with Java? I am thinking that maybe jTableViewExtended would be a solution but I assume that jTableViewExtended only works for B4J and not for B4A and B4I. The reason I want to use B4J is because I need the code to also work on B4A and B4I.
I need to know the selected cell or selected column on a tableview. I have looked extensively in the forum and have not found a answer. I know that B4J always knows the SelectedRow and that the selected cell can get highlited so I visually know what column (cell) is selected. But I need code that will tell me what column is selected. I thought maybe .SelectedColumn but if so I have not found it. Is there any simple way to get it with Java? I am thinking that maybe jTableViewExtended would be a solution but I assume that jTableViewExtended only works for B4J and not for B4A and B4I. The reason I want to use B4J is because I need the code to also work on B4A and B4I.
jmon Well-Known Member Licensed User Longtime User Apr 18, 2017 #2 to retrieve which column / cell is selected: Code: Sub AppStart (Form1 As Form, Args() As String) '.. tv1.SingleCellSelection = True End Sub Sub tv1_SelectedCellChanged (RowIndex As Int, ColIndex As Int, Cell As Object) Log(RowIndex) Log(ColIndex) Log(Cell) End Sub Upvote 0
to retrieve which column / cell is selected: Code: Sub AppStart (Form1 As Form, Args() As String) '.. tv1.SingleCellSelection = True End Sub Sub tv1_SelectedCellChanged (RowIndex As Int, ColIndex As Int, Cell As Object) Log(RowIndex) Log(ColIndex) Log(Cell) End Sub
EnriqueGonzalez Expert Licensed User Longtime User Apr 18, 2017 #3 just 2 small comments. The UI code in B4J, B4A and B4I is not compatible with each other, that means: only works for B4J and not for B4A and B4I. Click to expand... This is also true for Tableview, what it is fully compatible is most of the Non UI, stringutils, types, arrays, etc. There are some work on creating tables in B4A that are very good, so i think even when the UI code is not compatible, you are still covered For the second comment if you write sub + space + tab you will be presented with a list, click in any of the items and you will be shown with each of the events belonging to the item just like this one. Code: Sub tv1_SelectedCellChanged (RowIndex As Int, ColIndex As Int, Cell As Object) Upvote 0
just 2 small comments. The UI code in B4J, B4A and B4I is not compatible with each other, that means: only works for B4J and not for B4A and B4I. Click to expand... This is also true for Tableview, what it is fully compatible is most of the Non UI, stringutils, types, arrays, etc. There are some work on creating tables in B4A that are very good, so i think even when the UI code is not compatible, you are still covered For the second comment if you write sub + space + tab you will be presented with a list, click in any of the items and you will be shown with each of the events belonging to the item just like this one. Code: Sub tv1_SelectedCellChanged (RowIndex As Int, ColIndex As Int, Cell As Object)
Mikelgiles Active Member Licensed User Longtime User Apr 18, 2017 #4 jmon said: to retrieve which column / cell is selected: Code: Sub AppStart (Form1 As Form, Args() As String) '.. tv1.SingleCellSelection = True End Sub Sub tv1_SelectedCellChanged (RowIndex As Int, ColIndex As Int, Cell As Object) Log(RowIndex) Log(ColIndex) Log(Cell) End Sub Click to expand... Wonderful solution. So simple! Now I need to figure out why I missed it so totally. I did look at SelectedCellChanged but my assumption on what it did was totally wrong. I need to take a look at it again and try to figure out why I missed it so bad. Thanks very much jmon! Upvote 0
jmon said: to retrieve which column / cell is selected: Code: Sub AppStart (Form1 As Form, Args() As String) '.. tv1.SingleCellSelection = True End Sub Sub tv1_SelectedCellChanged (RowIndex As Int, ColIndex As Int, Cell As Object) Log(RowIndex) Log(ColIndex) Log(Cell) End Sub Click to expand... Wonderful solution. So simple! Now I need to figure out why I missed it so totally. I did look at SelectedCellChanged but my assumption on what it did was totally wrong. I need to take a look at it again and try to figure out why I missed it so bad. Thanks very much jmon!
Mikelgiles Active Member Licensed User Longtime User Apr 18, 2017 #5 Enrique Gonzalez R said: if you write sub + space + tab you will be presented with a list, click in any of the items and you will be shown with each of the events belonging to the item just like this one. Click to expand... Thanks very much! that is a very handy helper. I will remember to us it for sure. Upvote 0
Enrique Gonzalez R said: if you write sub + space + tab you will be presented with a list, click in any of the items and you will be shown with each of the events belonging to the item just like this one. Click to expand... Thanks very much! that is a very handy helper. I will remember to us it for sure.