JavaFx 2.1, 2.2 TableView update issue

后端 未结 7 1010
青春惊慌失措
青春惊慌失措 2021-02-06 17:41

My application uses JPA read data into TableView then modify and display them. The table refreshed modified record under JavaFx 2.0.3. Under JavaFx 2.1, 2.2, the table wouldn\'t

7条回答
  •  逝去的感伤
    2021-02-06 18:44

    I have the same problem, and not being able to add SimpleStringProperty to the POJO's used by JPA makes this a bit problematic. But it seems to me that this should be fixable issue because I have noticed the following behavior:

    1. In my application, clicking on a row in the table populates some text fields on the screen, that the user can then edit.
    2. At that point the user can save the data, or create a new item with the same or changed data. If the user creates a new item, which is then inserted into the observable list that the tableview represents, the change is immediately reflected in the contents of the tableview. However if the user just saves the change the new data is not reflected in the table. To put the new data in the list I'm simply doing

      trialList.set(currentIndex, tempTrial);
      
    3. And here's what I think points to this as a fixable issue: if I scroll the affected row out of view on the table and then scroll it back, the 'new' value(s) are now presented.

    Hopefully, this can be fixed. Sorry this isn't an answer, so to speak, but might provide some insight for a fix.

提交回复
热议问题