Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Update ListView after EditDialog problem  RSS feed

 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!