johnf wrote:
> On Friday 22 June 2007 10:15, Ed Leafe wrote:
>> On Jun 22, 2007, at 1:11 PM, <[EMAIL PROTECTED]>
>>
>> <[EMAIL PROTECTED]> wrote:
>>> How do we clear the dataset without triggering the "no records in
>>> dataset"
>>> notification upon requery?
>>>
>>> We are intentionally setting the sql where clause to "0=1" when the
>>> user
>>> presses a "Clear" button and would like to clear the screen without
>>> the
>>> message. We thought about manually setting the dataset to {}, but
>>> then the
>>> child records may not clear. Bottom line...how do we emulate a
>>> "clearDataset" method?
>> You can't avoid triggering the exception, but you can handle it.
>>
>> try:
>> <do your clearing stuff>
>> except dabo.dException.NoRecordsException:
>> pass
>
> To be a bit clearer:
>
> OnClear(self):
> bizobj.setWhereClause('0=1')
> try:
> self.Form.requery()
> except dabo.dException.NoRecordsException:
> pass
>
> does not work because Dabo is handling the exception in the "requery()".
Yeah, here's another place where IMO we are handling exceptions
inappropriately. I don't have an answer as to how we should to this, but
I don't think the Dabo framework should be deciding to throw up message
dialogs instead of re-raising the original exception.
If you did biz.requery() instead in the try: block, it would work as Ed
indicated.
--
pkm ~ http://paulmcnett.com
_______________________________________________
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/dabo-users/[EMAIL PROTECTED]