Yeah I have tried a few different versions. Always seems to be something. I am still trying to get my head around extracting the data from ObservableMap<string,object>
Is it possible to take all the elements from an object and put into Labels without using a listener?
Cheers
This is my current attempt. I am able to update the cell with text taken from the ObservableMap. I am not however able to set the text for multiple values.
At the moment the cell is printing just the artist value. I would like it to print year, and album etc. I tried adding them all to a string but that does not seem to work.
Knute Snortum wrote:Can't test it, but try something like this:
So I gave this a go but coming across similar issues where there is definitely a value going into a list but it is showing blank. So it does not seem to want to set the text with that string. hmmm.
Knute Snortum wrote:Hey, maybe you don't need setCellFactory. Maybe just setting the setCallValueFactory is enough. Try:
Hi again. I am using ListView and there is no setCellValueFactory method that I can use. Besides I am populating the ListView with Media Objects so I can play those when you double click the cell. By changing the value I would be getting rid of the ability to play the media.
I am thinking I might just create a class that can extract the Metadata separately and just call that class. Maybe a clunky approach but sure when I have hit a brick wall=)
Thanks again for all the help. This really is a great forum=)
I managed to stumble upon a solution that works. It actually works really well. I don't really know why I was so adamant on trying to extract the metadata iand put into cells when I could have just done it this way. Oh well a learning curve.
So the solution was to just create the media elsewhere and put into a GridPane. Then create an observable List of GridPanes and assemble that into a ListView.
Here are the main two parts. Nothing really new but just how it works together. I have yet to test with my library class but I think it should work.
Thanks again for sticking around. I believe I have gotten smarterer.......=)