Struggling Handling Focus of 1 field

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

MouseUp
Posts: 41
Joined: Sun Feb 14, 2010 3:41 pm

Re: Struggling Handling Focus of 1 field

Post by MouseUp » Sat May 16, 2015 11:25 pm

If you want to keep the graphic, then you need to Disable the graphic... Select the Pointer Tool, then double click on the graphic, then check the "Disabled" box in its Basic Properties palette.
Thanks,

MouseUp

mrcoollion
Posts: 738
Joined: Thu Sep 11, 2014 1:49 pm

Re: Struggling Handling Focus of 1 field

Post by mrcoollion » Wed Sep 30, 2015 7:32 pm

Do not know if this is handy for some but I needed to save the field data as soon as the field was left by the user.
When a user left the field by clicking on another button the routine was not triggered so I combined the following and that works great for me.

In the main stack I placed a command called UpdateVarField with variable theFieldName. This command does everything I would like to do after a user leaves that field, of course you can do that different or even place a routine (command or function) local. The idea is to use 'on exitField' and 'on closeField' both, that makes it work.
Maybe someone can use this...

Code: Select all

on exitField
   put the name of me into tVar
   replace quote with "@" in tVar
   set itemdelimiter to "@"
   put item 2 of tVar into theFieldName
   UpdateVarField theFieldName
end ExitField

on closeField
   put the name of me into tVar
   replace quote with "@" in tVar
   set itemdelimiter to "@"
   put item 2 of tVar into theFieldName
   UpdateVarField theFieldName
end closeField

Post Reply