A typical form with a grid (subclassed). TABLEA is opened in form.load().

Now, if I set grid.column1.controlsource="TABLEA.column" in form
designer, when the form was executed, VFP would complain:

Error loading file - record number 3. TABLEA <or one of its members>.
ControlSource: Alias "TABLEA" is not found.

If I modified the form, clear grid.column1.controlsource, set
grid.column.text1.controlsource="tablea.column", then the form could be
loaded without problem.

Why? Isn't form.load() fired before grid.column.controlsource looks for
its data?



--
SoftMedia Technology Co., Ltd.
Website: http://www.softmedia.hk Tel: (852)2743 4228
* TryEasy Accounting/POS/Trading/ERP solutions

Re: VFP9: grid.column.controldsource vs grid.column.text1.controlsource by Man-wai

Man-wai
Thu Aug 03 06:58:08 CDT 2006

> Why? Isn't form.load() fired before grid.column.controlsource looks for
> its data?

Is there a possibility that form.load() got skipped when the form was
loaded under special conditions?

--
.~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.06) Linux 2.6.17.6
^ ^ 19:57:02 up 18 days 3:20 0 users load average: 1.00 1.00 1.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

Re: VFP9: grid.column.controldsource vs grid.column.text1.controlsource by Man-wai

Man-wai
Thu Aug 03 07:28:06 CDT 2006

> Now, if I set grid.column1.controlsource="TABLEA.column" in form
> designer, when the form was executed, VFP would complain:
>
> Error loading file - record number 3. TABLEA <or one of its members>.
> ControlSource: Alias "TABLEA" is not found.

I just found that setting form.grid.column.controlsource="column" (ie,
without the "TABLEA." alias, the form.load() would also be fired
correctly. How could this be possible? The alias specification alone
bypassed form.load()!


--
.~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.06) Linux 2.6.17.6
^ ^ 20:26:01 up 18 days 3:49 0 users load average: 1.00 1.00 1.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

Re: grid.column.controldsource vs grid.column.text1.controlsource by Imaginecorp

Imaginecorp
Thu Aug 03 19:22:20 CDT 2006

Strange, I just tried it and it works for me.
In the load event of the form, I put in :
Select 0
use <<dbcname>>!<<tablename>>
Grid columns have the fields from this table as the controlsource
Try it with the dbc name...
Mohammed

"Man-wai Chang" <info@softmedia.hk> wrote in message
news:%23BL$T8qtGHA.4648@TK2MSFTNGP04.phx.gbl...
>A typical form with a grid (subclassed). TABLEA is opened in form.load().
>
> Now, if I set grid.column1.controlsource="TABLEA.column" in form designer,
> when the form was executed, VFP would complain:
>
> Error loading file - record number 3. TABLEA <or one of its members>.
> ControlSource: Alias "TABLEA" is not found.
>
> If I modified the form, clear grid.column1.controlsource, set
> grid.column.text1.controlsource="tablea.column", then the form could be
> loaded without problem.
>
> Why? Isn't form.load() fired before grid.column.controlsource looks for
> its data?
>
>
>
> --
> SoftMedia Technology Co., Ltd.
> Website: http://www.softmedia.hk Tel: (852)2743 4228
> * TryEasy Accounting/POS/Trading/ERP solutions



Re: grid.column.controldsource vs grid.column.text1.controlsource by Jack

Jack
Thu Aug 03 23:12:49 CDT 2006

On Fri, 04 Aug 2006 10:58:57 +0800, Man-wai Chang <info@softmedia.hk>
wrote:

>Imaginecorp wrote:
>> Strange, I just tried it and it works for me.
>> In the load event of the form, I put in :
>> Select 0
>> use <<dbcname>>!<<tablename>>
>> Grid columns have the fields from this table as the controlsource
>> Try it with the dbc name...
>
>Attached file could demonstrate the bug.
>
>If you create a form directly from the base class Form, add a grid (as
>in simpleform.scx), form.load() would be fired before the grid columns
>checked their controlsource.
>
>If you create a class MYFORMCLASS as form (which contains the same
>grid), then you create a myform.scx out of class MYFORMCLASS, then the
>form.load() would be fired *after* the grid columns checked their
>controlsource.

It looks like a bug. It works if you set the column controlsources in
the .vcx, but not in the .scx.

The problem appears to be VFP validating the controlsources as it
loads the .scx.

Re: grid.column.controldsource vs grid.column.text1.controlsource by Man-wai

Man-wai
Fri Aug 04 00:05:20 CDT 2006

> It looks like a bug. It works if you set the column controlsources in
> the .vcx, but not in the .scx.
>
> The problem appears to be VFP validating the controlsources as it
> loads the .scx.

The bug(?) would also not appear if you *don't* prefix the field name
with a table/alias name in grid.column.controlsource.

--
SoftMedia Technology Co., Ltd.
Website: http://www.softmedia.hk Tel: (852)2743 4228
* TryEasy Accounting/POS/Trading/ERP solutions

Re: grid.column.controldsource vs grid.column.text1.controlsource by Imaginecorp

Imaginecorp
Sat Aug 05 11:06:26 CDT 2006

Naturally... If I understand your reply correctly, As the form and grid are
now part of a single class and have been further subclassed, the Forms Init
would fire, then the contained objects (grids) init before the forms load,
Isn't this what OOP is all about... IMO this is not a bug, Bindcontrols may
be the solution...
Mohammed


"Man-wai Chang" <info@softmedia.hk> wrote in message
news:u0hsxH3tGHA.4336@TK2MSFTNGP06.phx.gbl...
> Imaginecorp wrote:
>> Strange, I just tried it and it works for me.
>> In the load event of the form, I put in :
>> Select 0
>> use <<dbcname>>!<<tablename>>
>> Grid columns have the fields from this table as the controlsource
>> Try it with the dbc name...
>
> Attached file could demonstrate the bug.
>
> If you create a form directly from the base class Form, add a grid (as
> in simpleform.scx), form.load() would be fired before the grid columns
> checked their controlsource.
>
> If you create a class MYFORMCLASS as form (which contains the same
> grid), then you create a myform.scx out of class MYFORMCLASS, then the
> form.load() would be fired *after* the grid columns checked their
> controlsource.
>
> --
> SoftMedia Technology Co., Ltd.
> Website: http://www.softmedia.hk Tel: (852)2743 4228
> * TryEasy Accounting/POS/Trading/ERP solutions
>



Re: grid.column.controldsource vs grid.column.text1.controlsource by Jack

Jack
Sat Aug 05 12:39:12 CDT 2006

No. It doesn't matter if it has been subclassed or not. Form's
Load() fires first, then control's Init()s, then Form Init().

On Sat, 5 Aug 2006 12:06:26 -0400, "Imaginecorp" <imaginecorp@msn.com>
wrote:

>Naturally... If I understand your reply correctly, As the form and grid are
>now part of a single class and have been further subclassed, the Forms Init
>would fire, then the contained objects (grids) init before the forms load,
>Isn't this what OOP is all about... IMO this is not a bug, Bindcontrols may
>be the solution...
>Mohammed
>
>
>"Man-wai Chang" <info@softmedia.hk> wrote in message
>news:u0hsxH3tGHA.4336@TK2MSFTNGP06.phx.gbl...
>> Imaginecorp wrote:
>>> Strange, I just tried it and it works for me.
>>> In the load event of the form, I put in :
>>> Select 0
>>> use <<dbcname>>!<<tablename>>
>>> Grid columns have the fields from this table as the controlsource
>>> Try it with the dbc name...
>>
>> Attached file could demonstrate the bug.
>>
>> If you create a form directly from the base class Form, add a grid (as
>> in simpleform.scx), form.load() would be fired before the grid columns
>> checked their controlsource.
>>
>> If you create a class MYFORMCLASS as form (which contains the same
>> grid), then you create a myform.scx out of class MYFORMCLASS, then the
>> form.load() would be fired *after* the grid columns checked their
>> controlsource.
>>
>> --
>> SoftMedia Technology Co., Ltd.
>> Website: http://www.softmedia.hk Tel: (852)2743 4228
>> * TryEasy Accounting/POS/Trading/ERP solutions
>>
>

Re: grid.column.controldsource vs grid.column.text1.controlsource by Man-wai

Man-wai
Sat Aug 05 21:36:09 CDT 2006

Jack Jackson wrote:
> No. It doesn't matter if it has been subclassed or not. Form's
> Load() fires first, then control's Init()s, then Form Init().

If you subclassed the form+grid, the grid.column.controlsource got
validated first before form.load(). Look at the thread "Event sequence bug".

--
.~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.06) Linux 2.6.17.6
^ ^ 10:35:01 up 20 days 17:58 0 users load average: 1.01 1.04 1.01
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

Re: grid.column.controldsource vs grid.column.text1.controlsource by Jack

Jack
Sun Aug 06 00:54:44 CDT 2006

On Sun, 06 Aug 2006 10:36:09 +0800, Man-wai Chang
<toylet.toylet@gmail.com> wrote:

>Jack Jackson wrote:
>> No. It doesn't matter if it has been subclassed or not. Form's
>> Load() fires first, then control's Init()s, then Form Init().
>
>If you subclassed the form+grid, the grid.column.controlsource got
>validated first before form.load(). Look at the thread "Event sequence bug".

I understand that completely. I was responding to the post that
claimed with a subclassed form, form Load() occurs after the Init() of
objects from the class. That is not true.

Re: grid.column.controldsource vs grid.column.text1.controlsource by Man-wai

Man-wai
Sun Aug 06 03:45:54 CDT 2006

> I understand that completely. I was responding to the post that
> claimed with a subclassed form, form Load() occurs after the Init() of
> objects from the class. That is not true.

Ok...

--
.~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.06) Linux 2.6.17.6
^ ^ 16:45:02 up 21 days 8 min 0 users load average: 1.03 1.03 1.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

Re: grid.column.controldsource vs grid.column.text1.controlsource by Imaginecorp

Imaginecorp
Sun Aug 06 09:12:20 CDT 2006

Subclass of a subclass... The objects contained fire first...Try it
Mohammed

"Jack Jackson" <jacknospam@pebbleridge.com> wrote in message
news:tu0bd29p4m0aeu1ouqtvq3d87370u12koi@4ax.com...
> On Sun, 06 Aug 2006 10:36:09 +0800, Man-wai Chang
> <toylet.toylet@gmail.com> wrote:
>
>>Jack Jackson wrote:
>>> No. It doesn't matter if it has been subclassed or not. Form's
>>> Load() fires first, then control's Init()s, then Form Init().
>>
>>If you subclassed the form+grid, the grid.column.controlsource got
>>validated first before form.load(). Look at the thread "Event sequence
>>bug".
>
> I understand that completely. I was responding to the post that
> claimed with a subclassed form, form Load() occurs after the Init() of
> objects from the class. That is not true.