New topic: 

Detecting TextField's changed value

<http://forums.realsoftware.com/viewtopic.php?t=35640>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        basil.bourque          Post subject: Detecting TextField's 
changed valuePosted: Tue Sep 28, 2010 3:03 pm                         
Joined: Thu Apr 15, 2010 10:41 pm
Posts: 91
Location: Seattle                How do you detect when the user has changed 
the value in a TextField? 

The event "TextChange" happens for every keystroke, which seems redundant with 
the "KeyUp" event. We don't care about the value _as_ it changes, we only care 
after the value is changed when user completes data entry such as leaving the 
field or pressing Enter.

The event "LostFocus" happens regardless of whether the field value was changed 
by the user or not.

And if set by code on another control, I want the TextField to fire an event.

When the user enters and leaves a field, the current state should be compared 
to the original state. If different, fire an event. Ditto for code setting the 
TextField's value.

Is this possible in REAL Studio 2010?

As a workaround, I suppose we could create a subclass of TextField. Add a 
property to remember the original value, named something like "Old". Add a 
method such as "SetValue", passing a new value as String. That method would 
compare the old and new values. If different, then what? Fire an event? A 
custom event definition? 

Has anyone already shared such code?

--Basil Bourque      
_________________
--Basil Bourque

http://crafted-software.blogspot.com/
Using REAL Studio 2010 r3.1 with REAL Server 2009 r1.2 on Mac OS X 10.6.4  
                             Top            Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to