How to prevent user from locking a field 
Author Message
 How to prevent user from locking a field

On a table frame on my form I have a field on the right most column designed
for users to left click on and then slide the mouse down over as many
records as they wish to select.  The field is logical.  As they slide the
mouse down the color of the field changes and the value is turned to False.
I then use this field to setGenFilter the table when the user clicks a
button.

My question is how can I prevent users from locking a record when they click
on the field.

Here is the code I am using so far:

In the built in action method of the field:
;--------------------------------------------------------------
method action(var eventInfo ActionEvent)
id = eventInfo.id()
if id = DataLockRecord then
 disableDefault
endif
if self.value = True then
 Self.Color = Blue
else
 Self.color = Gray
endif
endMethod
;----------------------------------------------------
In the built in mouseDown method of the field:
;------------------------------------------------------
method mouseDown(var eventInfo MouseEvent)
moveto(self)
if select.recordStatus("Locked") then
 select.unlockRecord()
endIf
if self.value = False then
   self.value = True
else
   self.value = False
endif
endMethod
;------------------------------------------------
In the built in mouseEnter method of the field:
;------------------------------------------------
method mouseEnter(var eventInfo MouseEvent)
var
 TopLeft,
 BotRight Point
endVar
disabledefault
if eventInfo.isLeftDown() then
 moveto(self)
   if select.recordStatus("Locked") then
    select.unlockRecord()
   endIf
 if self.value = False then
    self.value = True
 else
    self.value = False
 endif
   self.action(MoveScrollDown)
else
endif
endMethod

Thanks for your help in advance!

-Bruce



Tue, 20 Dec 2005 02:54:02 GMT
 How to prevent user from locking a field

Quote:

> My question is how can I prevent users from locking a record when they click
> on the field.

the simplest way would be to not let them do this is Edit Mode.. clicking on a
field doesn't lock the record.. clicking on a field *in Edit Mode* locks the
record..

--

Steve Green - Diamond Software Group, Inc - Waldorf Maryland USA
Corel CTech Paradox - http://www.diamondsg.com - Support/Downloads/Links
---------------------------------------------------------------------------------

Do you need a Sanity Check? http://www.diamondsg.com/sanity.htm
Upgrade/Downgrade versions? http://www.diamondsg.com/upgrade.htm
-------------------------------------------------------------------------



Tue, 20 Dec 2005 04:24:47 GMT
 How to prevent user from locking a field

Quote:
> the simplest way would be to not let them do this is Edit Mode.. clicking
on a
> field doesn't lock the record.. clicking on a field *in Edit Mode* locks
the
> record..

Thanks for the reply. Yes, that would be the easiest way to do it, keep the
user from entering edit mode, but I need to change the value of the field
from true to false as the user passes their cursor over the field.  The form
has to be in edit mode to do this I think?

I wonder if there is some way to filter the table based on the color, alone,
of the field object? Then I would not need to change the value of the field
and I could avoid edit mode.

-Bruce



Tue, 20 Dec 2005 04:15:12 GMT
 How to prevent user from locking a field

You could use a tcursor in the background, keeping it open and in edit mode.

The form would NOT have to be in edit mode to do this.

--
--
Tony

"I woke up and was able to get myself out of bed.
Being that fortunate, what's to complain about?"
_____________



Tue, 20 Dec 2005 05:21:37 GMT
 How to prevent user from locking a field
Rather than keeping them from locking it, why not unlock it the
instant the change is done.  Also, you can't lock a field, only a
record.

Liz

Quote:

> On a table frame on my form I have a field on the right most column designed
> for users to left click on and then slide the mouse down over as many
> records as they wish to select.  The field is logical.  As they slide the
> mouse down the color of the field changes and the value is turned to False.
> I then use this field to setGenFilter the table when the user clicks a
> button.

> My question is how can I prevent users from locking a record when they click
> on the field.

> Here is the code I am using so far:

> In the built in action method of the field:
> ;--------------------------------------------------------------
> method action(var eventInfo ActionEvent)
> id = eventInfo.id()
> if id = DataLockRecord then
>  disableDefault
> endif
> if self.value = True then
>  Self.Color = Blue
> else
>  Self.color = Gray
> endif
> endMethod
> ;----------------------------------------------------
> In the built in mouseDown method of the field:
> ;------------------------------------------------------
> method mouseDown(var eventInfo MouseEvent)
> moveto(self)
> if select.recordStatus("Locked") then
>  select.unlockRecord()
> endIf
> if self.value = False then
>    self.value = True
> else
>    self.value = False
> endif
> endMethod
> ;------------------------------------------------
> In the built in mouseEnter method of the field:
> ;------------------------------------------------
> method mouseEnter(var eventInfo MouseEvent)
> var
>  TopLeft,
>  BotRight Point
> endVar
> disabledefault
> if eventInfo.isLeftDown() then
>  moveto(self)
>    if select.recordStatus("Locked") then
>     select.unlockRecord()
>    endIf
>  if self.value = False then
>     self.value = True
>  else
>     self.value = False
>  endif
>    self.action(MoveScrollDown)
> else
> endif
> endMethod

> Thanks for your help in advance!

> -Bruce



Tue, 20 Dec 2005 06:40:05 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. Prevent other user from locking a row (rowlock?)

2. Prevent user from printing record fields

3. Preventing exclusive table lock with UPDATE

4. Preventing application lock?

5. How do I prevent TABLE LOCKS in VIEWS?

6. How to Prevent locks on tempdb ?

7. How to prevent a table lock with UPDATE

8. prevent table lock when using BCP?

9. Preventing Table Lock Escalation

10. Prevent locking on UPDATE.

11. prevent table lock on bcp?

12. Prevent table lock with update,delete statement


 
Powered by phpBB® Forum Software