Ed Leafe wrote:
> On Aug 28, 2008, at 6:22 PM, Paul McNett wrote:
> 
>> The dropdown list is getting set to a Value of 0. The Keys property
>> doesn't have a key on 0. That is the direct cause of the error.
> 
>       What are your thoughts on catching this error and logging it  
> dabo.errorLog instead of causing a traceback?

Honestly, I like the traceback because it forces the appdev to deal with 
it up front (and us to make it easier to deal with, if appropriate). 
This particular issue is a bummer, because it is so common, but perhaps 
it'll force us to come up with a better solution.

Currently I think my best advice is to make sure DefaultValues in the 
bizobj is set appropriately for each field.


>> Just for giggles, please set these properties in the radiolist:
>>
>> Choices = ["< zero >", "1", "2", "3", "4"]
>> Keys = {0:0, 1:1, 2:2, 3:3, 4:4}
>> ValueMode = "Key"
> 
>       I'm sure you know this, but for the newcomers: you don't need to set  
> Keys to a dict; you can use a simple list, as long as the keys are 1:1  
> matched to the Choices. So this code could more simply read:
> 
> Choices = ["< zero >", "1", "2", "3", "4"]
> Keys = [0, 1, 2, 3, 4]
> ValueMode = "Key"

Yes, so the index of the Keys list is the index of the Choices list. But 
in this case, I was anticipating a possible next step:

Choices = ["1", "2", "3", "4"]
Keys = {0:0, 1:0, 2:1, 3:2, 4:3}

IOW, both 0 and 1 map to choice "1", if that's a sensible default.

Of course, the right way to do this if the default should be 1 would be 
to set it in the bizobj.

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]

Reply via email to