[Gambas-user] Little DataCombo bug

Benoit Minisini gambas at ...1...
Fri Jun 8 19:49:48 CEST 2007


On vendredi 08 juin 2007, Leandro Anthonioz Blanc wrote:
> Hi all! I'm designing data bound forms in Gambas 1.9.49. Controls like
> DataSource, DataBrowser and DataControl works perfectly. However, I
> discover a little DataCombo bug. Every time a form is opened, DataCombo
> allways shows first field different to Datacombo "Field" property, not
> (necessary) field marked in "Display" DataCombo property. For example:
> suppose I have a table like this:
>
>     MyTable
>     -------
>     RecordId  (key)
>     FieldOne
>     FieldTwo
>
>     If I configure a DataCombo with properties like this:
>
>     cmbMyDataCombo
>     --------------
>     Table: MyTable
>     Field: RecordId
>     Display: FieldTwo
>
> ... when forms open, MyDataCombo shows "FieldOne" field contents, not
> "FieldTwo" field contents. However, this can be solved executing line
> "Me.cmbMyDataCombo.Refresh(TRUE)" (True argument is required to solve it).
> After execute this line, this time DataCombo shows "FieldTwo" field
> content. I think problem is caused because first time that Reload sub in
> comp/src/gb.db.form/DataCombo.class file is executed, $sDisplay variable is
> not assigned yet (is an empty string), and default behaviour in such case
> is show first field different to "Field" DataCombo property field. But I
> don't know how to set $sDisplay at startup to solve it. I think that
> "something" should call Display_Write() property procedure before Refresh()
> to set $sDisplay variable. I hope this information can be useful. Thank you
> very much.
>

The bug was in the Display property that didn't call Refresh(TRUE) like the 
other properties. I will fix it in my next commit.

Thanks for the bug report!

Regards,

-- 
Benoit Minisini




More information about the User mailing list