Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tablerevert and updateable views
Message
De
03/03/1997 23:03:34
 
 
À
03/03/1997 14:39:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00022691
Message ID:
00022773
Vues:
40
>>>I have a toolbar object also ref'd in app object. A button on the toolbar calls a tablerevert function in the app object for one of my updateable views.
>>>
>>>When I call bring up the form and change a field, then undo it with the toolbar button the field doesn't update. But if I add a button to the form and call the app object tablerevert function it does work. It seems to be some scoping thing, but I don't want to place the button on the form, I need to call tablerevert from the toolbar. I'm new at this, so I could be missing something simple! Help!
>>
>>One thing you might be missing - a ToolBar does not take the focus away from the textbox the user is typing in.
>>
>>So to force the text they typed to be registered, Windows needs to be told the user has finished typing. This is the same in all windows applications - you will see MS people using TAB before clicking on toolbars in some demos to make sure it works...
>>
>>In VFP the solution to that is to use _SCREEN.ActiveForm.ActiveControl.SetFocus() to force the update of the value.
>>
>>
>>I'm not sure form your description if this is what you are seeing or not.
>>I don't think it's what you are describing.
>
>That's it! In the toolbutton I set focus to another field on the form and the revert worked fine! A thousand thanks!
>
>When I tried to set focus to the active form active control the focus just stayed with the active control, so I created another control on the form (aptly named ducttape), transferred focus to it, ran the app object revert routine, then went back to the formerly active control. It worked like a charm. You have saved many hairs on my head! There's probably a better way to do this, but at least now I know what the problem was!
>
>thanx++
>tony

Another way to do it is using The WriteToBuffer method in Tastrade example:

IF TYPE("thisform.ActiveControl") == "O" AND ;
UPPER(thisform.ActiveControl.BaseClass) <> "GRID"
IF TYPE("thisform.ActiveControl.ControlSource") <> "U" AND ;
!EMPTY(thisform.ActiveControl.ControlSource)
IF EVAL(thisform.ActiveControl.ControlSource) <> thisform.ActiveControl.Value
REPLACE (thisform.ActiveControl.ControlSource) WITH thisform.ActiveControl.Value
ENDIF
ENDIF
ENDIF
System Analyst
Nabil B. Ghrayyeb
nabilg@hotmail.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform