File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable Binding Update Bound Item List

 
Carlos Conti
Ranch Hand
Posts: 131
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • 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: 131
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic