Sibylle Koczian wrote:
> Am Mittwoch, 24. September 2008 19:22:13 schrieb Paul McNett:
>> johnf wrote:
>>> On Wednesday 24 September 2008 09:18:32 am Sibylle Koczian wrote:
>>>> After thinking about it some more: _should_ it be corrected? Or wouldn't
>>>> it be quite acceptable if manually constructed PKs could only be
>>>> assigned by some workaround (like entering them in a textbox without
>>>> data binding and assigning them to the right database field by code)?
>>>> Because it certainly is and should be a non standard practice. But I
>>>> haven't tried this out and at the moment I don't really know how to code
>>>> such a workaround
>>> Sure in the beforeSave() or at some proper place in your code
>>> self.BizObj.setFieldVal("fieldName", value)
>> And I'll reiterate again that I do this all the time, by using
>> biz.DefaultValues["pk"] = myFunc. It works without any special workaround.
>>
>
> Yes, if there is a function producing the PKs you want. Not quite so simple
> if
> you invent each one (abbreviations for example). In that case the value would
> come from some control in the form, and I don't really think myFunc should
> have to know about the UI. I will play around with this and see where I get.
No, the biz shouldn't be aware of the ui at all. If it were me, I'd keep
the PK invisible from the UI (and keep it meaningless), and just define
another field for the abbreviation field that may well be unique but
isn't *the* pk.
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]