Advanced onDataChange to a field

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

Advanced onDataChange to a field

Postby tysonj » Wed Aug 31, 2011 1:02 pm

Hi all :)

I want to call a method every time there is a change made to a text field in a web client and that to without loosing focus of that field :idea: did not find onDataChange method help full as it was calling my desird method after losing the focus on the field.
I went through the scheduler plugin and actually trying if it could help. :?

In the mean time it would be Great :!: if some one could suggest me any other solution to that...
Last edited by tysonj on Thu Sep 01, 2011 7:53 am, edited 1 time in total.
User avatar
tysonj
 
Posts: 47
Joined: Tue Sep 28, 2010 2:07 pm
Location: Paris, France.

Re: Advanced onDataChange to a field

Postby Joas » Wed Aug 31, 2011 1:53 pm

Have you tried to return false in the onDataChange? Then the user cannot leave the field.

Maybe you can explain a little more about what you're trying to achieve, then people can help better.
Joas de Haan
Yield Software Development
Need help on your project? yieldsd.com
User avatar
Joas
Site Admin
 
Posts: 842
Joined: Mon Mar 20, 2006 4:07 pm
Location: Leusden, NL

Re: Advanced onDataChange to a field

Postby lwjwillemsen » Wed Aug 31, 2011 2:21 pm

In Foxpro we have the event 'InteractiveChange' on a form field which fires every time the data in the field is changed (through keyboard or mouse) without having to move to another field.

To my knowledge this event does not exist in Servoy, onDataChange is only fired at focus change in text fields.

Regards,
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: Advanced onDataChange to a field

Postby tysonj » Wed Aug 31, 2011 6:25 pm

Mr. lwjwillemsen you got my point..... :)
lwjwillemsen wrote:In Foxpro we have the event 'InteractiveChange' on a form field which fires every time the data in the field is changed (through keyboard or mouse) without having to move to another field.

To my knowledge this event does not exist in Servoy, onDataChange is only fired at focus change in text fields

Actually I was testing a functionality in web client... like for instance I am entering a password in a password field and want to instantly call a method each time I entered/deleted a character in the field to check and display its Strength. I used the scheduler plugin but in vain may be I didn't do well on that....
User avatar
tysonj
 
Posts: 47
Joined: Tue Sep 28, 2010 2:07 pm
Location: Paris, France.

Re: Advanced onDataChange to a field

Postby maria » Thu Sep 01, 2011 2:09 am

tysonj wrote:Hi all :)

I want to call a method every time there is a change made to a text field and that to without loosing focus of that field :idea: did not find onDataChange method help full as it was calling my desird method after losing the focus on the field.
I went through the scheduler plugin and actually trying if it could help. :?

In the mean time it would be Great :!: if some one could suggest me any other solution to that...

tysonj, we had a similar problem and used the keyListener plugin to get around it.
Set the listener on the field/s and you're done :)

Cheers,
Maria
maria
 
Posts: 424
Joined: Thu Apr 16, 2009 1:18 am
Location: Sydney

Re: Advanced onDataChange to a field

Postby tysonj » Thu Sep 01, 2011 7:52 am

Hi maria... thnx for the reply.... :)
well I was testing on web client and have come through the keyListener plugin but could not suceed.... could u just help me out how this plugin can be used in web client to meet my purpose of advanced onDataChange.
User avatar
tysonj
 
Posts: 47
Joined: Tue Sep 28, 2010 2:07 pm
Location: Paris, France.

Re: Advanced onDataChange to a field

Postby pbakker » Thu Sep 01, 2011 9:51 am

Due to the nature of the Web Client, where the UI runs in the browser, but the logic runs on the Server, an implementation of a keyListener/interactiveChange event is not likely to be very successful, as it means a roundtrip to the server and back from the browser on each keypress, which, with the latency of the connection between the browser and the server, will most likely cause a degraded user experience.

Depending on the requirements you might consider including and executing some clientside (so in the browser) javascript, but you'd have to consider security and cross browser javascript differences.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands


Return to Web Development

Who is online

Users browsing this forum: No registered users and 2 guests