On Mar 1, 2007, at 11:19 AM, Ken Dibble wrote:
>>> biz.requery()
>>>
>> This has to be started at the form level. Dabo uses the
>> Chain of
>> Responsibility pattern, and you're bypassing the initial part of the
>> chain by jumping directly to the bizobj. The form needs to be in the
>> call, because the bizobj might raise an exception which the form is
>> designed to catch. The form also causes the value of the active
>> control to be flushed to the bizobj, preventing things from being out
>> of sync. After the query, it raises events and refreshes the controls
>> on the form.
>
> Okay, so:
>
> biz = dabo.biz.dBizobj(conn)
>
> isn't really the right way to go no matter what level in the OO
> hierarchy
> I'm at?
No, it was the call to requery() which I was addressing. Requerying
is a process that affects UI, bizobj and data layers. You call is
bypassing the UI, so the UI has no opportunity to react to the requery.
> Then why does the grid work when I call biz.requery()?
Because under the hood, grids bind to an event raised by the bizobj:
dEvents.RowNumChanged if it is associated with a bizobj. This allows
it to reflect the current record pointed to by the bizobj. Regular
controls are bound to dEvents.Update, which the form raises as part
of the requery process.
> So thanks, Ed. I'm having difficulty communicating what the real
> issue is
> here: that the grid works, but the textbox doesn't. Doing the
> textbox the
> "right way" still doesn't work. I've tried it and posted code earlier.
> Doing the grid "any old way" works.
>
> Can you please provide some insight on this issue?
There are two problems, as I see it. First, and most importantly,
the text control needs to have both of its data binding properties
set. Change the entry in the cdxml file to look like (I'm assuming
the field name is 'songName'):
<dTextBox RegID="thisSong" DataSource="musSongs"
DataField="songName" sizerInfo="{'BorderSides':['All'], 'Proportion':
0, 'HAlign': 'Left', 'VAlign': 'Top', 'Border': 3, 'Expand': False}"
designerClass="controlMix" Name="dTextBox1"></dTextBox>
Second, the requery needs to be called on the form, so that the form
can raise an Update event. The control reacts to Update by refreshing
its value from its DataSource/DataField.
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users