B4J Question tv1.Items .RemoveAt()

davelew1s

Active Member
Licensed User
Longtime User
Hi!
I am having problems with this (tv1.Items .RemoveAt and tv1.Items .InsertAt) I have included an example ... with the line indicated in the example commented out it works i.e. shows the textfields but also shows the original line not what I want. With the line 'in' it removes the original line but doesn't show the textfields...any help?
Thanks Dave.
 

Attachments

  • table test.zip
    1.3 KB · Views: 281

stevel05

Expert
Licensed User
Longtime User
You are replacing the String objects in the line with text fields, is this what you wanted to do?. When I run it, the replaced fields show when I scroll down and up.

If you replace them with text objects, they appear immediately.
 
Last edited:
Upvote 0

davelew1s

Active Member
Licensed User
Longtime User
Hi Steve!
Thanks for the reply ...yes I want to replace the line with textfields so that I can edit and then replace that line with the updated line...does that make sense. I have a sub to refresh the table in the final APP.
Dave.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Hi Dave,

Yes I can see what you are after here.

After a quick google for "JavaFX TableView refresh" it appears that this is a common problem, There appear to be a few 'fixes' one of which you can't use as you are changing the type of object in the row which would use Properties.

You can see in the code that I've tried a different method of removing all of the rows and re-adding them which doesn't seem to work either. Which is a shame as it would probably have been smoother than the one that does work.

The third option which currently runs in the attached does work, although there is a visible delay as it set's each column invisible then visible, and you may have to run it again when you remove the TextFields and replace them with string objects

Not perfect, but working. Perhaps someone else has a tidier solution.

Sorry I can't help more.
 

Attachments

  • TEWorkAround.zip
    1.6 KB · Views: 317
Last edited:
Upvote 0
Top