• 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

JTable Binding Update Bound Item List

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have a JTable with a bound List<A>, with bindings setup with Netbeans6.8. My problem is the following: I succesfully bind the instances of A in the list, but when editing its properties, the model is successfully updated, but the table is not refreshed. Before starting a thousand workarounds I would like to ask you if there's any neat method to set a more accurate update strategy (I already set Read/Write, but of course for the list, not for the underlying instances).

I hope I made myself clear.

Best regards and many thanks in advance.

Carlos.
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy, Carlos!

Well, personally, I don't like NetBeans (this is just, of course, a personal opinion), so I don't know exactly how your environment is. But the thing is, in order to refresh the JTable so it displays the data of your TableModel, you should call fireTableDataChanged() after updating the TableModel.
 
Carlos Conti
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Roberto, thanks for the quick answer....

the problem is that since I am using bindings, if I retrieve the tablemodel I get an instance of an inner private class of the JTableBinding class (org.jdesktop.swingbindings.JTableBinding$BindingTableModel)... to which I am not gaining access, therefore not being able to fire the update as you said... hmmm.... any ideas?

Hoping that the retrieved object was a descendant of the DefaultTableModel, I tried to call that method via Reflection, but got the NoSuchMethodException.

Carlos.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic