PDA

View Full Version : On Key and Checkbox problem



mangomel
03-08-2010, 02:43 PM
Why On Key actions doesn't work after clicking on Checkbox?

I created blank project, inserted checkbox and Page>Script>On key I wrote:
if e_Key == 13 then
Dialog.Message("sth", "sth")
end

Now, when I ran the app, after pushing Enter key a message appeared correctly. But after I clicked (checked) on the checkbox, pushing Enter did nothing. Note, that after the click, the checkbox is selected (dot square). Maybe because of that keys doesn't work?
Could sb explain?

RizlaUK
03-08-2010, 03:08 PM
Note, that after the click, the checkbox is selected (dot square). Maybe because of that keys doesn't work?

spot on :yes

mangomel
03-09-2010, 04:11 AM
Well, ok. So I'll be happy if you would tell me what to do to make keys work "after".
I tried page.redraw but didn't helped. Actually I have no idea what to do with this issue.

RizlaUK
03-09-2010, 04:31 AM
ah, ok, i thought you was just asking why this was happening

try putting the below line of code into the checkbox 'OnClick' event to remove focus after its been clicked

Page.SetFocus("")

mangomel
03-09-2010, 05:25 AM
I thought about it but in help there was written that setfocus works for only some specific object. There is nothing about set focus to page.

Anyway, thanks very much!

RizlaUK
03-09-2010, 07:34 AM
thats where "knowing AMS" comes into play, you get to know the tricks are not in the help file