B4J Question How to update a column in a TableView

Mikelgiles

Active Member
Licensed User
Longtime User
Another advantage of nodes is that they can be easily updated. The attached example creates a table with two columns. The second column can be updated:

Where can I find the' attached example' code for updating a column in a tableview?
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Could you point the post where you quoted it?

If you are in the need to update values directly from the tw, then you may want to use informatix tableview extended.

If you prefer to update values with external controls (passing the row in to text fields and a button to save the information back into the tw) then its easy with

B4X:
Tw.selectedrowvalues()

Or the event tw selected row changed
 
Upvote 0

Mikelgiles

Active Member
Licensed User
Longtime User
Mmmm if you are refering about this one:

https://www.b4x.com/android/forum/threads/tableview-tutorial.35542/#content

In the very first post at the end you can find the example.

Or for what I understand is that you want to update the whole column?

I looked in the tablExample.zip file but I did not see anything that looked like it was updating anything. I will take a closer look. And no to the whole column. I need to update a single cell rather than a whole column or row. I think I may have found a sub program that does it that I am going to try.
 
Upvote 0

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
oh okey okey i understand.

Actually is easy to update a cell.

B4X:
'For the selected row
tw.selectedrowvalues(0) = textfield1.text

'I did not test the code here, but this should work for non selected rows: 
dim row() as string = tw.items.get(0) 
row(0) = textfield1.text

'This is part is necessary for the tw to redraw itself (not reloading)
tw.setcolumnvisible(0,false)
tw.setcolumnvisible(0,true)
 
Upvote 0
Top