Out of curiosity Vicente, what happens if you open the prompt with the editor popup as its owner? Instead of passing 'window' as the owner, pass 'amountTextInput.getWindow()'. My guess is that this will work, but I'm not at a terminal in which I can test this. -T
On Fri, Oct 2, 2009 at 6:04 PM, Todd Volkert <[email protected]> wrote: > Just looked into this. The issue isn't so much that previewSaveChanges is > being called too many times, but that clicking the OK button in the prompt > to dismiss the prompt is causing the row editor to try to save its changes > *again* (and again, ...). You can see this by hitting ENTER or SPACE to > dismiss the prompt instead. > > I'll let you know when a fix is in :) > > Cheers, > -T > > > On Thu, Oct 1, 2009 at 9:42 PM, Vicente de Rivera III < > [email protected]> wrote: > >> yeah you're right mr.Todd, haha sorry.btw, I think this is a bug with the >> TableRowEditor. I tried it with the tableroweditor demo, added a validation >> that will prompt if the amount text input is empty >> tableViewRowEditor.getRowEditorListeners().add(new >> TableView.RowEditorListener.Adapter() { >> >> @Override >> public Vote previewSaveChanges(RowEditor rowEditor, TableView >> tableView, int rowIndex, int columnIndex, >> Dictionary<String, Object> changes) { >> if (amountTextInput.getText().isEmpty()) { >> Prompt.prompt(MessageType.ERROR, "amt empty", null, >> window); >> return Vote.DENY; >> } >> return Vote.APPROVE; >> } >> }); >> >> while in edit mode and amountTextInput is empty, clicking any other row >> will call previewSaveChanges a lot >> > >
