onFocusLost is a bit late

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

onFocusLost is a bit late

Postby maria.kyselova » Tue Jul 30, 2013 8:47 am

Hi guys,

I have a toolbar in my window where I enter data into a field.
The toolbar has a button with an method attached to it (that executes when clicked).
The field has the onFocusLost method that also does important stuff.

Now, if I type in my field and then click on the menu button ('save'), then onFocusLost is fired AFTER the button method.
The application logic and validations are going in the wrong order this way and that ruins my app. Depending on what I typed in the field, local validations are fired and a search screen might be popped up, eventually ending up in valid input. But if the toolbar button action fires first, it always assumes those checks to have run and therefore complains more than it should or even crashes :)

Tell me it's a bug and I don't have to deal with it :wink:
Cheers,
Maria
maria.kyselova
 
Posts: 172
Joined: Thu Aug 09, 2012 12:56 am

Re: onFocusLost is a bit late

Postby Andrei Costescu » Wed Jul 31, 2013 11:27 am

Smart client or web client?
I wonder if it's related to another case in which the event order is actually correct, but the problem was that even after the modal dialog is open by focus-lost event, the click will still execute (without closing the dialog).
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: onFocusLost is a bit late

Postby maria.kyselova » Thu Aug 01, 2013 4:36 am

Andrei Costescu wrote:Smart client or web client?
I wonder if it's related to another case in which the event order is actually correct, but the problem was that even after the modal dialog is open by focus-lost event, the click will still execute (without closing the dialog).


Smart client, Andrei.
Not sure if those are related, but someone from Servoy would probably know.
Cheers,
Maria
maria.kyselova
 
Posts: 172
Joined: Thu Aug 09, 2012 12:56 am

Re: onFocusLost is a bit late

Postby Andrei Costescu » Fri Aug 02, 2013 9:47 am

The problem I mentioned was like this:

Field focused, modified then a click on a button happened => onFocusLost did execute first (you said it didn't) - a modal dialog was shown by the onFocusLost but then the action event on the clicked button was triggered (and you might expect the action not to trigger because of the modal being shown before, but it doesn't work like that). Is it the same for you or in your case is the onFocusLost code actually triggered after the click?
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: onFocusLost is a bit late

Postby maria.kyselova » Thu Aug 08, 2013 7:40 am

Andrei Costescu wrote:The problem I mentioned was like this:

Field focused, modified then a click on a button happened => onFocusLost did execute first (you said it didn't) - a modal dialog was shown by the onFocusLost but then the action event on the clicked button was triggered (and you might expect the action not to trigger because of the modal being shown before, but it doesn't work like that). Is it the same for you or in your case is the onFocusLost code actually triggered after the click?


In my case onFocusLost does get triggered but after the click on the button, Andrei.
So it goes: field focussed, modified, then click on a button - voila, button action fires, then onFocusLost fires.
It's worth mentioning that this happens only for toolbar buttons, the ones created with plugins.window.addToolBar(). Normal Servoy buttons don't play games like that.
Cheers,
Maria
maria.kyselova
 
Posts: 172
Joined: Thu Aug 09, 2012 12:56 am

Re: onFocusLost is a bit late

Postby jcarlos » Thu Aug 08, 2013 8:10 am

maria.kyselova wrote:In my case onFocusLost does get triggered but after the click on the button, Andrei.
So it goes: field focussed, modified, then click on a button - voila, button action fires, then onFocusLost fires.
It's worth mentioning that this happens only for toolbar buttons, the ones created with plugins.window.addToolBar(). Normal Servoy buttons don't play games like that.


I think it's a bug. You should report this in the support dashboard at https://support.servoy.com/secure/Dashboard.jspa

Best, Carlos
Juan-Carlos Sanchez, Stanford University - Law and Economics
jcarlos
 
Posts: 578
Joined: Thu May 04, 2006 8:55 pm
Location: Palo Alto, California USA

Re: onFocusLost is a bit late

Postby maria.kyselova » Thu Aug 08, 2013 8:44 am

jcarlos wrote:
maria.kyselova wrote:In my case onFocusLost does get triggered but after the click on the button, Andrei.
So it goes: field focussed, modified, then click on a button - voila, button action fires, then onFocusLost fires.
It's worth mentioning that this happens only for toolbar buttons, the ones created with plugins.window.addToolBar(). Normal Servoy buttons don't play games like that.


I think it's a bug. You should report this in the support dashboard at https://support.servoy.com/secure/Dashboard.jspa

Best, Carlos


Perhaps I will, Carlos.
Cheers,
Maria
maria.kyselova
 
Posts: 172
Joined: Thu Aug 09, 2012 12:56 am

Re: onFocusLost is a bit late

Postby Andrei Costescu » Thu Aug 08, 2013 9:50 am

It's something else then. I agree with Carlos.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: No registered users and 5 guests