On Aug 24, 2008, at 10:20 AM, Sibylle Koczian wrote:
> File "/usr/lib/python2.5/site-packages/dabo/ui/
> dDataControlMixinBase.py",
> line 116, in update
> self.Value = src.getFieldVal(self.DataField)
> File "/usr/lib/python2.5/site-packages/dabo/ui/uiwx/
> dControlItemMixin.py",
> line 370, in _setValue
> self.KeyValue = value
> File "/usr/lib/python2.5/site-packages/dabo/ui/uiwx/
> dControlItemMixin.py",
> line 229, in _setKeyValue
> raise ValueError, _("Trying to set %s.Value to these invalid
> selections: %s") % (self.Name, invalidSelections)
> ValueError: Trying to set dDropdownList_9409996432.Value to these
> invalid
> selections: [0]
>
> In spite of this the control shows the first entry. But if I save
> the record
> the clientfk is 0 and not the primary key of the first list entry
> (which is
> 1).
>
> So I'm afraid this is worse than it was before. Value and
> PositionValue seem
> to have got mixed up.
Can you add a couple of debugging lines to the code and let me know
what it prints out?
## *!* ## Dabo Code ID: dDropdownList-dPage
def afterInit(self):
biz = self.Form.getBizobj("hours")
(names, pks) = biz.getClients()
print "NAMES", names
print "PKs", pks
self.Choices = names
self.Keys = pks
self.ValueMode = "Key"
self.PositionValue = 0
If you have ValueMode = "Key", you need to have a key that equals
zero, based on the error message above. I just want to make sure that
that key exists in the Keys property.
-- Ed Leafe
_______________________________________________
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]