On Mon, Jul 27, 2009 at 2:52 PM, Paul McNett<[email protected]> wrote:
> Miguel Lopes wrote:
>>
>> If we run your code without the line:
>> dropDown.ValueMode = "key"
>>
>> Then there is no exception raise. But, as expected, the value of the
>> "title_id" field does not get recorded to the db, because it is a
>> string, not an integer. So there is something wrong with setting
>> ValueMode.
>
> The offending line(s) aren't directly causing the traceback. The problem
> appears to be that the bizobj reports that the value of contact.title_id
> is 0.

Then somehow the bizobj is setting the contact.title_id to 0 even
though there is no default value set in the bizobj (nor the db for
that matter).

> Do a:
>
> dropDown.Choices.append("---None---")
> dropDown.Keys.append(0)
>
> and you should see the traceback disappear.

This works as expected.

> You probably need to set a sensible default value for title_id in your
> bizobj (one that is one of the choices presented in the list).

That worked (even without the presence of the 0 Key).

But seems to me that the bizobj (perhaps more accurately it is the
control) should not try to get a default value from the bizobj if
there is none.

Miguel


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to