Ok, I have now got the drop down populating properly with all error message
gone. Everything is saving to the database properly as well.
Here's the appropriate section of the cdxml file:
<dDropdownList sizerInfo="{'RowSpan': 1, 'ColSpan': 1, 'HAlign': 'Left',
'ColExpand': True}" Keys="[u'0', u'1', u'2',
u'3']" rowColPos="(5, 1)" Choices="[u'-Select-',
u'AL', u'TX', u'WA']"
designerClass="controlMix" DataSource="clients"
DataField="stateprov"></dDropdownList>
I added the following line to the bizobj file which stopped the
"String must be present in the choices" error:
self.DefaultValues = {"stateprov": "-Select-"}
My Question now (looking at the cdxml snippet), is there anyway to display
the full name of the state in the drop down list, but save the abbreviation
to the database on self.Form.save()
Thanks in advance
Carey
On Wed, Jul 15, 2009 at 7:42 PM, Paul McNett <[email protected]> wrote:
> Carey Gagnon wrote:
> > I have tried one other way, and that was setting up a database
> table
> > for the states. I can get that to work no problem. My thought was..why
> the
> > unnecessary over head. To me that would mean the call to the database.
> This
> > isn't a field that is likely to change. Doesn't it run faster from teh
> code
> > without a database call?
> >
> > Also I wan't to use this method when I do my own program for a couple of
> > fields that will only have 2 to 4 options.
>
> Okay then you need to either:
>
> 1) Put a None ("<None>") row in the list
>
> 2) Assign a default value to the bizobj so that there isn't a chance
> that the field will get a value of anything other than what you present
> in the choice list.
>
> Paul
>
>
[excessive quoting removed by server]
_______________________________________________
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]