Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BINDEVENT at INIT
Message
De
16/05/2007 11:56:34
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
BINDEVENT at INIT
Divers
Thread ID:
01226051
Message ID:
01226051
Vues:
90
Hi All,

I have two questions in one:

1. How do I get a BINDEVENT to work in the INIT of a Cursor Adapter, where the bind is on a THISFORM.Method reference?

I have a base textbox class with a BINDEVENT like:
BINDEVENT(THISFORM, "update_form_controls", THIS, "set_for_state", 1)
This action works. A call to THISFORM.update_form_controls fires the Control.set_for_state method on each control on the form. Apparently, the THISFORM in the BINDEVENT command in the INIT of the control is able to resolve the THISFORM reference at INIT-time.

However -- I place the same type of BINDEVENT in the INIT of a Cursor Adapter class and the action fails. Anyone know why?


2. How do I get a good THISFORM reference at INIT-time?

At INIT-time, I have a form control that wants to pull its data from a collection object on the form. It looks like:
THISFORM.o_form_coll && <-- the form collection with the control data.
Inside the control INIT is:
lo_form = THISFORM && <-- point of failure because THISFORM is not yet valid.
lo_coll = lo_form.o_form_coll
lv_data = lo_coll.get_data(THIS.c_csr_dot_field)
I know I am not the first person to address this and somewhere in the past I have seen and implemented strategies to handle it, but cannot remember what I or others did.

Thanks in advance for your help.

Larry
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform