Page 1 of 1
_
Posted: Fri Dec 30, 2011 10:16 pm
by uneu
_
How do I detect field change?
Posted: Thu Jan 05, 2012 5:24 pm
by sgilito
Hi,
I looking for an "on Changed" field event, to do an action when the field value change.
Any idea to do this?
Thanks in advance.
Re: How do I detect field change?
Posted: Thu Jan 05, 2012 5:46 pm
by Klaus
Hi sglito,
sgilito wrote:I looking for an "on Changed" field event, to do an action when the field value change.
You need to trap the "closefield" message ideally in the script of htat field(s), check the dictionary for more info!
From the docs:
"Sent to a field when the focus is being removed from that field and the field's content has changed."
So this might be what you are looking for.
Best
Klaus
Re: detect touch of 2 controls?
Posted: Fri Jan 06, 2012 4:09 pm
by sgilito
Thanks Klaus,
I need to trap when the field change in any character (without lost field focus). It's for a dynamic list search depends of a field value, for example in a client list when I type "J" display all names begining with "J", when I type more characters the list is filtered for each one, finaly if the field value is "JAMES" then list show all the client names begining with "JAMES".
Regards.
Re: detect touch of 2 controls?
Posted: Fri Jan 06, 2012 7:29 pm
by jmburnod
Hi sgilito,
I think you need something like that (no iPad tested)
Code: Select all
on keydown pKey
put pKey after fld "fType"
put fld "fList" into tCont
put fld "fType"&"*" into tFilter
filter tCont with tFilter
put tCont into fld "fFound"
end keydown
Best regards
Jean-Marc
Re: detect touch of 2 controls?
Posted: Fri Jan 06, 2012 9:18 pm
by FireWorx
Nice sgilito,
So how do we go about refreshing the fFound field when the user uses the back space key or delete key because he misspelled a word? The delete key doesn't trigger the keydown pkey script. I played around but didn't find the right script for that part of it. Your script worked well other than that. Nice thread although it may have to be moved it oesn't seem to relate to the title "detect touch 2 Controls.
=] Dave
Re: detect touch of 2 controls?
Posted: Fri Jan 06, 2012 10:44 pm
by jmburnod
Hi
The delete key doesn't trigger the keydown pkey script
Yes. rawkeydown is the way
Code: Select all
on rawkeydown pRawKey
put pRawKey
end rawkeydown
Nice thread although it may have to be moved it oesn't seem to relate to the title "detect touch 2 Controls
Yes.
Best regards
Jean-Marc
Re: _
Posted: Sun Jan 08, 2012 2:11 am
by FireWorx
Cool so yes that helped. Here is the script that makes for a pretty nice "auto populate" field when filtering based on a second hidden field of values.
on Keydown pKey
put pKey after fld "fType"
put fld "fList" into tCont
put fld "fType"&"*" into tFilter
filter tCont with tFilter
put tCont into fld "fFound"
end Keydown
on rawKeyUp theKeyNumber
if theKeyNumber is 65288 then ## the delete key is being pressed
put fld "fList" into tCont
put fld "fType"&"*" into tFilter
filter tCont with tFilter
put tCont into fld "fFound"
else pass rawKeyUp -- don't forget this!
end rawKeyUp