Author: John
Posted: 2009-07-15 at 20:02:27
On Wednesday 15 July 2009 03:58:23 pm Carey Gagnon wrote:
> John, thanks so much! I knew there had to be a simpler way. Ihad already
> successfully created the drop downlist it was getting it populated without
> a db look up that I was having an issue with. Now it is populating and
> correctly saving everything to the database.
>
> Still one issue however. I am now getting the following error shown in the
> terminal window (I'm running linux) This is only a partial trace back:
>
> File "/usr/lib/python2.5/site-packages/dabo/ui/uiwx/dControlItemMixin.py",
> line 356, in _setStringValue
> raise ValueError(_("String must be present in the choices."))
> ValueError: String must be present in the choices.
>
> Any ideas?
> This is also preventing the form from resetting itself.
>
You might want to add '<None>' to your list. The problem is when the dropdown
is first init - it does not have any data - therefore the need to have a null
value. In Dabo the null value is converted to the string '<None>'.
But now that you have gotten this far - try the other ways to populate a
dropdown. They will offer more control and better results than hard coding
the 'Choices'.
Johnf