Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checkbox in the primary bizobj's Grid
Message
De
23/04/2001 15:54:41
Gerald McKinsey
Keystone Consulting Services, Inc.
Yorktown, Indiana, États-Unis
 
 
À
16/04/2001 13:48:22
Gil Munk
The Scarborough Group, Inc.
Baltimore, Maryland, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00495867
Message ID:
00498716
Vues:
20
Hi Gil,

I have just struggled with a scenario exactly like this myself, only with a combobox. I thought I was losing my mind. It seems that each change was reflecting the value of the change I did last. Here is the solution (kludge) I came up with. In the InteractiveChange() method, make the first line of code after your DODEFAULT() check this:

This.Value = This.Value

Seems kind of strange I know, but it seems that the value of the control is not quite in synch with the controlsource. I found a thread about this, but I can't remember the number at this moment. This should help you out. Let me know if you have any questions.

Brian

>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform