OnFocusGained and Buttons

I used the following method to save the value displayed in a button field to a global variable called FieldLock:

theelement = application.getMethodTriggerElementName();
thedataproviderid = elements[theelement].getDataProviderID()
globals.FieldLock = controller.getDataProviderValue(thedataproviderid)

I used this method to restore the value OnDataChange if the field was ‘locked’

theelement = application.getMethodTriggerElementName();
thedataproviderid = elements[theelement].getDataProviderID()
if (IsTheRecordLocked())
{
application.beep();
controller.setDataProviderValue(thedataproviderid,globals.FieldLock)
}

The method works great on combo boxes but will not work when the field is a button. I think it does not always execute the method OnFocusGained.

John McCann

i think it doesn’t work because buttons don’t fire onDataChange…
Because you can’t edit the data on a button…

Why don’t you use the record locking of servoy?

Oops I meant radios not buttons. They are called buttons in filemaker. I sent an example of the problem in the solution attached to another posting.

I thought about using record locking but my understanding is that record locking locks out everyone but the person who aquires the lock.

I am working on a medical record application. After a medical record is signed it can’t be altered by anybody. Is thier a way to use record locking to lock out everybody? It would be much less code than locking each individual field.

Thanks

John McCann

i will look at youre radio problem but why don’t you disable all the input components if the record can’t be altered anymore?
Why are you still giving the impression to the user that it can edit?

For most of my forms it would be best if I disabled all of the elements when I want to lock the record. I tried this but I had problems with it because after I disabled/dimmed all of the elements the data stored in the fields was so dim it could not be read easily. (I am using the Servoy default look and feel) I want the user to be able to review the old medical records but not edit them. Is thier some way to disable a field without dimming it, or without dimming it so much?

Thanks,

John McCann

idoctor:
Is thier some way to disable a field without dimming it, or without dimming it so much?

Dimming is done by the LAF (OS GUI) something we cannot control.

radio problem is fixed (b6)

Thanks.

John McCann