This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 154068

Summary: observableList as default setting for d&d db table action
Product: guibuilder Reporter: polzleitner <polzleitner>
Component: BindingAssignee: issues@guibuilder <issues>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description polzleitner 2008-11-28 09:34:45 UTC
I use the form designer to bind a database to a JTable via drag-and-dropping a Database table to a JTable.

For clarity, let's assume the database table has the name "user". Then the initcomponents method will containg binding
code for a "userList" object. This code fails when I try to add records to the database table, because the associated
JTable object throws an IndexOutOfBounds exception. The jtable object is not updated.

Correction of this issue would be easy: Rather than having initComponents define a regular List, it should do a 
ObservableCollections.observableList instead. It can be verified that by manually selecting userList->Properties and
checking the "observable" checkbox the code will work.

It is not obvious that this checkbox should be enabled for most users. A very "hidden" feature. The checkbox should be
enabled by default when a database table is dropped to a JTable.
Comment 1 Jiri Vagner 2008-11-28 10:45:30 UTC
Thank for your enhancement. Master/Detail Sample Form wizard or New JDA Database Project wizard generates list with
checked the "observable" checkbox. We will also check this checkbox for d&d db table action.