• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Update ListView after EditDialog problem

 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there,
I have a ListView declared in a controller:

An Edit button whose action is linked to:

mainApp.showCategoryEditDialog receives the actual selectedCategory and the Dialog updates it as follow:

Of course setCategoryName uses the actual property (SimpleStringProperty) to update its content
Now, after closing the dialog, the focus returns to the categoryList but the content is still the old one.
If I select the same category and click edit again, the dialog shows the new (previously edited) value.
As another test I added

And the result is that the selectedCategory is added AND the categoryList is "refreshed" that is the edited value is properly displayed.
Now my expected behaviour is that updating the underlining category object should have triggered a kind of "refresh" of the categoryList.
Is my expectation wrong or am I updating the categoryList in the wrong way?
Thanks a lot for any feedback you might have!
Cheers,
zxxz

 
Giovanni De Stefano
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like the answer is in using the extractor pattern as described here.

In my case I had to:

initialise the observable list as
Where the Category model contains
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic