Re: Validation in TableViewEditor

2009-10-03 Thread Vicente de Rivera III
My mistake, thought it was working with amountTextInput.getWindow(). For now I'll leave it to my flag solution

Re: Validation in TableViewEditor

2009-10-03 Thread Todd Volkert
Nope - the prompt is showing over it's owner window, which is the editor popup. I'm still trying to think about how to get it to show up over the main window but work properly... On Sat, Oct 3, 2009 at 12:00 AM, Vicente de Rivera III < thirdy.deriv...@gmail.com> wrote: > AWESOME! The Prompt even

Re: Validation in TableViewEditor

2009-10-02 Thread Vicente de Rivera III
AWESOME! The Prompt even showed @ the TextInput. Works great now.To improve it more, can I get the Prompt to show below the TextInput? Currently it shows over the TextInput thanks Todd

Re: Validation in TableViewEditor

2009-10-02 Thread Todd Volkert
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,

Re: Validation in TableViewEditor

2009-10-02 Thread Todd Volkert
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 d

Re: Validation in TableViewEditor

2009-10-01 Thread Vicente de Rivera III
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() {

Re: Validation in TableViewEditor

2009-10-01 Thread Todd Volkert
That's really what the preview event is for though. We wouldn't want to code the alert or any error message into the validator, because it's too app-specific. So if we had a changes validator, it'd look exactly like the preview event does (where it passes you the changes, and you return ALLOW or

Re: Validation in TableViewEditor

2009-10-01 Thread Vicente de Rivera III
> I guess that's why I did a Prompt error message solution. > How about tableViewEditor.setChangesValidator( TableViewEditorChangesValidator ); where the isValid method of TableViewEditorChangesValidator accepts the object/row from the TableData

Re: Validation in TableViewEditor

2009-09-30 Thread Vicente de Rivera III
I guess that's why I did a Prompt error message solution. btw, ButtonPressListenter.buttonPressed attribute is really cleaning a lot of my code, really cool

Re: Validation in TableViewEditor

2009-09-30 Thread Vicente de Rivera III
although not much of a big deal, when a user would create a new record/row in the TableView, all the TextInput which should not be empty will all be colored red. I tried doing a simple boolean firstTimeInputFlag trick in the validator but failed. Any solution to this? thanks On Wed, Sep 30, 2009

Re: Validation in TableViewEditor

2009-09-30 Thread Todd Volkert
Why not just attach the appropriate validators to your text inputs? Then, when they're invalid, they'll paint themselves to look invalid, which should save you the burden of alerting the user as to why the edit is being denied. Then your previewSaveChanges() method becomes a simple deny vs. appro