filtering one bound jList on anothers selected ID

View: New views
2 Messages — Rating Filter:   Alert me  

filtering one bound jList on anothers selected ID

by Chris_C :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have two jLists bound to *different* tables using netbeans IDE persistence unit on a derby db

the second table (list) has a foreign key to the first tables ID (the foreign key is called groupID)

When the user clicks on the first list, I want to display only records in the second list that have the groupid of the first lists selected id. (err not a brilliant description but I how you understand!)

I'm struggling to progress further as I've not been able to find a similar tutorial.

Any ideas most welcome!
Thanks
Chris


Re: filtering one bound jList on anothers selected ID

by Chris_C :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok solved it (must have been waiting nearly 10 years for this functionality - *very* powerful)

I used the master detail crud wizard to see how it was done

Basically set the binding source to the first jList
this allows you to select ${selectedElement.siteCollection} (siteCollection - from the site table that the second jlist uses)
for display expression you can then choose the appropriate field...

very easy (as it turned out) very powerful

seems to work very well, I'd recommend anyone give netbeans 6.0 a good look!