Problem with FocusIn
Devin Asay
devin_asay at byu.edu
Mon Nov 5 10:09:43 EST 2007
Hi Claus,
I see that I misread your message, and that closeField was what you
needed. Very often in situations like yours I write both a closeField
and exitField handler so that I can account for all possible outcomes.
Sorry for misreading; hope I didn't add to the confusion. :-P
Devin
On Nov 5, 2007, at 3:55 AM, Claus Dreischer wrote:
> Hello Devin,
>
> i think i do want to use the closeField message :-)
> because i want to know when a field *has* changed.
>
> Context:
> The card has several fields like name, company, street, address, etc.
> a save button, to buttons for up and down paging, a "new" button
> and a "delete" button.
>
> What i'd like to achive is to remember the user to save his changes,
> when he changed a field and not saved it by pushing the "save" button.
> So i need a flag like "some-fields-have-changed" to evaluate when
> he is pressing the "up" or "down" button,
> or when he's leaving the card.
>
> Regards,
> Claus.
>
>
>> Hello Claus,
>
> ...
>
>>> The solution to my problem is the closeField message, which is only
>>> sent when the content *has* changed.
>>
>> What you want is the exitField message. It is sent when leaving the
>> field and the content has not changed.
>>
>> Devin
>>
>>>
>>>
>>>> check the field locking.
>>>>
>>>> from the docs:
>>>>
>>>> If the control is an unlocked field or a button whose menuMode is
>>>> "comboBox", the openField message is sent to it instead of the
>>>> focusIn message.
>>>>
>>>> A locked field receives the focusIn message when the user tabs to
>>>> it or otherwise makes it active (focused), or when text in it is
>>>> selected by a handler.
>>>>
>>>>> Hi,
>>>>>
>>>>> i have problems with the focusIn message.
>>>>>
>>>>> What i want to achive is to remember the value of a field
>>>>> when the user is editing it (on focusIn). After that (on
>>>>> focusOut),
>>>>> i would like to check the new value against the remembered one.
>>>>> If they are different, the change has to be saved,
>>>>> so i ask the user to do so when he's leaving the card.
>>>>>
>>>>> I think the focusIn message is not sent because even something
>>>>> like
>>>>>
>>>>> on focusIn
>>>>> beep
>>>>> end focusIn
>>>>>
>>>>> does not work.
>>>
>>
>> Devin Asay
>> Humanities Technology and Research Support Center
>> Brigham Young University
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
Devin Asay
Humanities Technology and Research Support Center
Brigham Young University
More information about the use-livecode
mailing list