Paul McNett wrote:
> Carey Gagnon wrote:
>> 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()
>
> Yes.
>
> drop.ValueMode = "Key"
> drop.Choices = ["Arizona", "California", "New York"]
> drop.Keys = ["AZ", "CA", "NY"]
>
> And to follow your fix for 'string must be present in the choices':
>
> drop.Choices.insert("-SELECT-")
> drop.Keys.append(None)
You probably want the "-SELECT-" to be in position 0 (top of list):
drop.Choices.insert(0, "-SELECT")
drop.Keys.insert(0, None)
And using ValueMode="Key" like I describe you can now select
"California" in a couple ways:
drop.Value = "CA"
drop.KeyValue = "CA"
drop.StringValue = "California"
drop.PositionValue = 2
By setting ValueMode="Key" you are telling Dabo to save the key to the
database, not the string.
Paul
_______________________________________________
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]