artificially causing a field to be left in a script

Dr. Hawkins dochawk at gmail.com
Thu Sep 27 20:13:11 EDT 2012


On Thu, Sep 27, 2012 at 10:42 AM, Bob Sneidar <bobs at twft.com> wrote:
> You would need to put it in a mouseUp handler in any button a user can click on
>while editing. If someone tabs out of the field, and the field has been altered,
>closeField will get sent ok. The issue is clicking a button, and only with OS X (if
>memory serves me, which is to say check it yourself)>

Since all I really need out of this is to set a flag, I set a
textChanged handler, which sets the changed to true.


> This brings up another point I have run into with editing data destined for a
>database. I don't really like to update data directly to a database as soon as I leave
>a field, because it is always possible in a multi-user system that someone got to the
>field and edited after another user reads it but before they update it. That means
>the first user will believe the column contains his edit, when actually it contains the
>edit of the second user who saved first. Sounds confusing but it can happen.

I've been pondering this, as I'll be going multi-user shortly.

My thinking so far is to lock the record in the SQL database upon
load.  If someone else tries to access, they would be informed of
read-only status (and offered a chance to break the lock if it's old
enough.)

Stepping a bit past that, I think I'll be caching data locally into
sqlite, and have a co-program pumping the updates from that back to
the cloud--the latency I'm seeing at the moment isn't acceptable for
individual fields.

...

> Obviously, if yours is not a multi-user system, most of that doesn't apply, but I do
>like to give the user clear feedback on what mode he is in. I know Filemaker writes
>to the database upon exiting the field, or going to another record. I never liked that.

Yuk.  That should be user and/or program dependent.  Then again, HyperCard . . .

-- 
Richard E. Hawkins, Esq.
(702) 508-8462




More information about the use-livecode mailing list