I'm sorry for this noob question but my head is spinning from reading all sorts of code and book samples, I still don't know how to do this.
I've made an FXML app and put TableViews, the source (MainDB) and the targets (table1, 2, 3). The MainDB loads stuff from a database. I want to Drag'N'Drop rows of data from the MainDB to table1.
What my simple mind thinks I should do in the Controller class is this: a) on MainDB when OnDragDetected, store the row in a temp var
b) on target when OnDragDropped, add temp in a ObservableList which in turn is added to the target.
The code i have in my Controller is this:
These tableviews reside in a SplitPane, one tableview on the right (mainDB) and the other on the left. Maybe the drag event doesn't "see" the tableview on the left? The sample code on JavaFX docs are clear, I understand it. What confuses me (probably), is that I'm attempting a two-step operation here where on the samples they use multi-step operations.
The copyFromSource event fires when I try to drag, not the addToTarget though...
I've managed to find a workaround to this, by using a click event to select a row from the mainDB and double click on target to set the data. It's not ideal though, I was planning on using the double click event on another operation...
Netbeans 8.1 - JavaEE 7 - Payara 4.1
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads