Note that there are some explanatory texts on larger screens.

plurals
  1. POJava FX 2 Cell Editing, Focus and Text Selection
    primarykey
    data
    text
    <p>I am testing JavaFX 2.1 and trying to get editable table views to behave the way I would like them to.</p> <p>I'm using the example from the JavaFX 2 documentation as a base :<a href="http://docs.oracle.com/javafx/2/ui_controls/table-view.htm" rel="nofollow noreferrer">http://docs.oracle.com/javafx/2/ui_controls/table-view.htm</a></p> <p>The example has 2 problems:</p> <ol> <li>The user is forced to click on a cell 3 times in order to edit it, once to select the row, once to select the cell and make it editable and a further click to focus the TextField</li> <li>The changes are only committed when the enter key is pressed, if the mouse is clicked outside of the cell, then the data entered in the cell is lost.</li> </ol> <p>On the other hand, one feature that does work correctly, is that I can select text, and re-position the caret within the TextField using the mouse as many times as I like.</p> <p>There are 2 questions here relating to both of these issues individually:</p> <p><a href="https://stackoverflow.com/questions/10331497/java-fx-2-table-cell-editing-and-focus">Java FX 2 Table Cell Editing and Focus</a></p> <p>and</p> <p><a href="https://stackoverflow.com/questions/10758035/javafx-2-1-updating-tableview">javafx 2.1 Updating TableView</a></p> <p>When the answer to first question is applied on it's own, I only have to click once to edit the cell (after the row has been selected) and I can still select text and move the caret.</p> <p>When the answer to the second question is applied on it's own, the edit is committed without the enter key being pressed, but I can only re-position the caret or select text once, if I try a second time, then the edit is committed.</p> <p>When I apply both answers together, focus is applied successfully and edits are committed when the mouse is clicked away, but I lose the ability to re-position the caret or select text entirely. Any mouse click within the cell commits the edit.</p> <p>My question is how can I fix the original 2 issues without losing the ability to position the caret and select text?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload