On 9/9/11 11:11 AM, Ed Leafe wrote:
> On Sep 9, 2011, at 1:09 PM, Paul McNett wrote:
>
>> This is regarding the long-standing 'trying to set Value to these invalid 
>> selections'
>> error, when the key from the database isn't in the set of possible keys for 
>> the choices.
>>
>> My thought is to have the control query the bizobj for the default value for 
>> the
>> field. If one is returned, and that value is a key in the control, then 
>> setFieldVal()
>> to that key.
>>
>> With me? Good or bad?
>
>       I'm sure you have an example in mind, but I found that confusing. Can 
> you explain it with a concrete example?

Sure. Yesterday I made my monthly app release (version 0.9.52). The prior 
month's 
version (0.9.51) added a new waiver_mode field to the customers table. This 
field can 
have three possible values ("NORMAL", "SMART", and "BLANKET"). Version 0.9.51 
didn't 
yet add waiver_mode to the customers bizobj, so any new customers added in that 
version got a value of '' in the database for that field (even though I had a 
DEFAULT 
"NORMAL" in the sqlite table definition - guess sqlite doesn't do DEFAULT).

So when I released 0.9.52 yesterday, even though the bizobj now has that field 
defined along with a default value of "NORMAL", any customers added in version 
0.9.51 
would still have a value of '' for the field. And the radio list bound to that 
field 
in the customers form (introduced in 0.9.52 yesterday) bombs out when 
waiver_mode is 
'', because that key isn't present in the choices.

Had this feature been in Dabo, the control would have found the default value 
from 
the bizobj (bizCustomers.DefaultValues["waiver_mode"]) and went ahead and 
changed the 
value in the bizobj.

Now, the real problem was my neglect, so I'm on the fence as to whether my idea 
is 
good or not.

Paul



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

Reply via email to