closeField and exitField problem
David Burgun
dave at looktowindward.com
Tue Oct 16 08:21:05 EDT 2007
On 15 Oct 2007, at 20:30, Björnke von Gierke wrote:
> Yes, I too think that validating user entries is one of rev's
> weaknesses. However, artificially increasing the problem by not
> using the fields as data source seems a bit strange to me,
> especially with your reasoning.
One area where this falls down is if you want to enter a password
type field. In this case when the user types a character you want to
display a "*" in the field while accumulating the key strokes in
local storage. You can't use the field as data storage in this case.
>
> How are these two lines completely different in their horribility?
>
> put field 1 of card 1 into x
> put the field1oncard1 of this stack into x
They are identical and are horrid since the script will break if you
remove the field at a later stage.
>
> If you're really that much into customprops, you can put the fields
> into them when you leave the card. or with a send in time message,
> or on mousemove, or ...
I don't want to reference an object directly if I can help it. When I
want to get or set the contents of an object I always use a handler
if that object that references the contents via "me", that way if you
remove the object you don't get errors elsewhere in the Stack, all
that happens is that the field no longer gets called.
>
> More likely is that i didn't understand the problem you have
> correctly, so maybe you should explain it in a different way.
>
No need since I had my own work-around and there's a better one
posted under this subject on this list which I will implement later on.
All the Best
Dave
> Bjoernke
>
>
> On 15 Oct 2007, at 20:48, Dave wrote:
>
>> Hi,
>>
>> I asked about this problem ages ago, but didn't get a response, so
>> I'm asking again as it's just come up again!
>>
>> I am running on a Mac. If the user fills in a field and then tabs
>> out of the field, either a closeField or exitField message is sent
>> to the field. All well and good. However, if the user clicks on a
>> button, nether messages are sent!
>>
>> This is supposedly normal behavior since from the docs:
>>
>> "If the lookAndFeel property is set to "Macintosh", the closeField
>> message is generally not sent when another control (such as a
>> button) is clicked. This is because clicked buttons do not receive
>> the focus on Mac OS systems, and therefore the selection remains
>> active."
>>
>> (incidentally, in this case the "lookAndFeel" and feel property is
>> set to "Appearance Manager", so according to the above it should
>> still send the message(s).)
>>
>> This effectively means that it\s impossible to ensure that a field
>> is valid using these messages, so what's the use of having them or
>> am I missing something.
>>
>> I want to let the user enter a number of fields and then when the
>> user clicks the button, I check to see if they are valid and if
>> not put if an error message. The problem is that the three field
>> must be examined together, so I'd like to be able to store the
>> contents of each field in a custom property of the stack and then
>> check them in the mouseUp handler of the button. I can't really
>> access the fields directly (as is put field "XXX" into whatever)
>> since the check may be run on a different card and it's really
>> horrible to access fields like that.
>>
>> Any ideas or suggestions would be greatly appreciated!
>>
>> All the Best
>> Dave
>
> _______________________________________________
> 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
More information about the use-livecode
mailing list