Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SetAll for readonly doesn't work
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
SetAll for readonly doesn't work
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01049935
Message ID:
01049935
Vues:
134
Hi everybody,

We have a form with a pageframe. Each page of this pageframe has a container with business objects and lots of controls. The container is instantiated in run-time. In one of the button on this container we call a method with the following code:
LPARAMETERS tlEnabled

WITH THIS

	.SETALL('TabStop', tlEnabled)

* Setting ReadOnly for drop down combos has no effect due to VFP combobox design
	.SETALL('style',IIF(tlEnabled,2,0),'cboViscodes')
	.SETALL('style',IIF(tlEnabled,2,0),'cboStates')
	.SETALL('style',IIF(tlEnabled,2,0),'cboCountry')

	.SETALL('ReadOnly',!tlEnabled)
	IF NOT tlEnabled
		.SETALL('lRefresh',!tlEnabled) && we need to have this property for comboboxes to refresh them properly
	ENDIF
ENDWITH
This code worked perfectly in VFP8. In VFP9 it doesn't make the controls accessible, e.g it looks like ReadOnly is still off.

We tried to test this problem on a new simple form. I created a form, bring a table into DE of the form (visually) and grab few fields so the controls were created for me. Put the button on the form with this code
thisform.lSwitch =  not thisform.lSwitch
thisform.SetAll('readonly',thisform.lSwitch)
and I'm having an error:

Property setting will not take effect until data environment reloaded (Error 1739)

You attempted to set a property on a data environment object (Relation, Cursor) while the data environment is loaded. The property value will be stored with the object, but the property will not take effect until the data environment is unloaded and then reloaded.

So, how can we make our code work? Is it a bug in VFP9?

Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform