Hi Vlado,

You are doing validation twice once in Ok action and once in ValueChanged.
Just do it once in ValueChanged.

>
>That dialogs have another issues. Only first have default action on Ok
>button and set ESC keystroke to close message. After first dialog close the
>main frame react on ESC keystroke and defaultButton.

The server side code does not wait on ULCAlert. The code that you have after
showing the alert gets executed immediately. Therefore you need to put the
code that executes after closing of alert in the Window Listener for the
alert:

                 alert.addWindowListener(new IWindowListener(){
                        public void windowClosing(WindowEvent event) {
                            System.out.println("Value Changed: refreshed
bean value: " + bean.getValue());
                            field1.setText(bean.getValue());
                            field1.requestFocusInWindow();
                        }
                    });

I hope this helps.

Thanks and regards,

Janak

>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] Behalf Of Vyvojava
>Sent: Tuesday, June 26, 2007 12:18 PM
>To: [EMAIL PROTECTED]
>Subject: [ULC-developer] DefaultButton and ValueChanged event
>
>
>Hi,
>
>I have a problem with different behaviour in form with defaultButton and
>valuechange listener on textfield. In my test application I've
>attached, I'm
>trying to validate text input after valuechange on textfield1.
>When value is
>not valid, it is reseted with the default value and exception is
>thrown. The
>exception is then catched, alert message is displayed, textfield is
>refreshed and focus is set on to correct input field. Ok button
>(defaultButton) revalidate the all form inputs and display error alert
>messages too.
>
>Behaviour is different when I type invalid input (e.g. "1") and invoke
>action on "Ok" button by hitting Enter or by mouse click.
>
>First scenario (enter) notify both listeners (action and valuechange) and
>display 2 alert messages. This is the output on console:
>
>changed field value: 1
>refreshed bean value:
>changed field value:
>ok performed
>
>That dialogs have another issues. Only first have default action on Ok
>button and set ESC keystroke to close message. After first dialog close the
>main frame react on ESC keystroke and defaultButton.
>
>Second scenario (button click) blocks action listener and notify
>valuechange
>listener on textfield only.
>
>changed field value: 1
>refreshed bean value:
>changed field value:
>
>I'd like to achieve behaviour from second scenario in both cases
>but I can't
>find any solution to achieve that. Any ideas are welcome.
>
>Thanks.
>Vlado
>
>
>--------------------------------------------------------------------------
>Tato sprava a vsetky pripojene subory su doverne a urcene vyhradne osobam
>alebo organizaciam, ktorym boli adresovane. Ak ste dostali tento e-mail
>omylom, prosim, upovedomte Chemosvit, a.s. ([EMAIL PROTECTED]).
>
>This email and any files transmitted are confidential and intended
>solely for the use of the individual or entity to which they are
>addressed. If you have received this email in error, please notify
>Chemosvit, a.s. ([EMAIL PROTECTED]).
>-------------------------------------------------------------------
>--------

_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer

Reply via email to