• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

an extractor for an observableList containing another ObservableList  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been searching around and figured the solutions is probably an extractor, but then written for events from an observableList instead of a property (if possible?)
I came upon this thread, but didn't succeed in modifying the code to work for my purpose: https://coderanch.com/t/666722/java/Notify-ObservableList-Listeners-Change-Elements



So the FilteredTestList is my problem.
I have a ObservableList of FilteredTestList (ObservableList<FilteredTestList<Test>>), and whenever another FilteredTestList is added, the observable events fire properly and I can update what needs to be updated.
No problem so far.
But whenever an item inside the FilteredTestList (more specific, a Test in FilteredTestList for the variable named filteredList) is updated, the events do not propagate.

So how do I either write an extractor that propagates update events for observableLists instead of properties or create some code that triggers update events to an outer ObservablesList from another ObservableList that is containted in the first object?
In my interface I'm building TreeItems based on this list, so whenever an item is added the tree should update and this doesn't happen by itself so events need to be sent to trigger these updates.
 
Marshal
Posts: 5986
155
Chrome Eclipse IDE Java Postgres Database Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this post helpful?

https://coderanch.com/t/666722/java/Notify-ObservableList-Listeners-Change-Elements
 
Kobe koro
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:Is this post helpful?

https://coderanch.com/t/666722/java/Notify-ObservableList-Listeners-Change-Elements



That's the post (or at least same thread) that I provided in my original topic.
I have solution in the meantime, but it's not really pretty (which is why I came here asking).



So in the class that needs the tree from this data, I add a listener to the outer Observable list. Whenever an event (add/remove) happens, I regenerate the entire list.
Then during the regenerate I also do the same thing for the inner Observable lists, pointing to a methode that only regenerates the tree section for that particular list.
Sadly enough I don't have anything to update my tree whenever an update/permutation happens. Have enough other things to do before I handle that.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!