Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checkbox in the primary bizobj's Grid
Message
From
16/04/2001 13:48:22
Gil Munk
The Scarborough Group, Inc.
Baltimore, Maryland, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
Checkbox in the primary bizobj's Grid
Miscellaneous
Thread ID:
00495867
Message ID:
00495867
Views:
83
I have a checkbox in a clistOneToManyObj Grid (bound to a logical field in the primary bizobj called .LPROCESS that is defaulted to TRUE when the view is initially opened) that I use to allow users to choose which rows to include in certain processing. I also want to use this checkbox's InteractiveChange to fire a method in the Primary BizObj to sum up totals for all rows for which the .lProcess value is TRUE and display the result on the form. The interactive code is at the bottom of this thread message. Here's what's happening:

1. If I let the code run by itself:
The first mouse click clears the checkbox but the value displayed stays the same. The second mouse click on the same row sets the checkbox and reduces the total amount by the value of the row. This is Just the opposite that I thought would happen.

2. If I step thru the code:
At the first mouseclick I enter the method, I can peek at the form and see the checkbox is cleared. The SumTotal() method gets the correct new total and the form refresh updates the displayed amount. But here's an anomoly - The logical field's value is .F. but the grid checkbox's value shows as .T. in the debugger. I step out of the code upto the Read Events, move the debugger screen aside but still over the app window and everything is perfect (checkbox is clear and amount displayed is correct). I close the debugger and the checkbox is now set but the amount is still correct.

I know that I'm missing something and I even checked out Hacker's Guide 6.0 but still lost. Any suggestions would be appreciated.

Thanks,
Gil Munk


*---------------------------------------------------------
*--- the interactivechange method code referred to.
*---------------------------------------------------------
IF NOT DODEFAULT()
RETURN .F.
ENDIF

Thisform.lockscreen = .T.

LOCAL lnRecord, loSelect

*--------------------------------------------------
*--- Select the view to which the grid is bound.
*--------------------------------------------------
loSelect = CREATEOBJECT('cSelect', Thisform.oPrimaryBizobj.Getalias() )
lnRecord = RecNo()

*-----------------------------------------------------
*--- Saving to lnSum is just for debugging.
*--- The SumTotal() method updates a BizObj property
*--- to which the form textbox control is bound and
*--- the form refresh updates display.
*-----------------------------------------------------
lnSum = This.Parent.Parent.Parent.Parent.Billinvoicesbizobj1.SumTotal()

*----------------------
*--- Get back, Jack
*----------------------
go lnRecord

Thisform.lockscreen = .F.
thisform.refresh()

RETURN .t.
Gil Munk


"If a nation expects to be ignorant and free, it expects what never was and never will be." - Thomas Jefferson
Next
Reply
Map
View

Click here to load this message in the networking platform