Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Spinner
Message
From
31/07/2006 06:08:31
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01141401
Message ID:
01141750
Views:
13
>>>>
>>>>In some cases it might be. However if a routine update is needed to underlying source no need to mess with iac.
>>>>PS: I read about dodefault, it would do default anyway unless supressed by nodefault (IOW sometimes it means you're doıng the default twice).
>>>>Cetin
>>>
>>>So far, I have tracked the problem to the fact that in the InteractiveChange the value of the field bound to this control does not change. The value is being updated because when I save the record the value from spinner is updating the field. I tried putting DODEFAULT() and removing DODEFAULT() but to no avail.
>>
>>But I meant why you need code there.
>
>Cetin,
>
>Here is the reason I have code in InteractiveChange method of the spinner. Imagine three controls on a form: a Spinner to show Quantity, a Textbox to show Unit Price and a Textbox to show Extended Price. User enters Unit Price and then clicks in the Spinner control clicking mouse on Up or Down wheel. As he/she changes the quantity I want to show the Extended price, obviously as a product of unit price and quantity. So I put the following simple code in the InteractiveChange:
>
>
>replace EXT_PRICE with UNIT_PRICE * QUANTITY in V_MYVIEW
>
>
>The above didn't work so I changed the code to use the Value of the Spinner and it work now.
>
>
>replace EXT_PRICE with UNIT_PRICE * this.value in V_MYVIEW
>
>
>I wish I can understand why using the field value of the field bound to the Spinner didn't work.
>
>Thank you.

I see. Using field value doesn't work because field doesn't yet comitted the new value. You can force it with:

this.value = this.value

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform