开发者

Powerbuilder: does a change in the computed field trigger itemchanged event

I have a computed field called c_total_qty in a datawindow which computes multiplication of two fields, one field is a database column and the second one is another computed field.

Now when c_total_qty's value changes, it does not trigger corresponding itemchang开发者_运维知识库ed event. Are computed fields work this way or there are errors in my code? If computed fields work this way, then what is the workaround?


ItemChanged is all about changes made through the UI, so from what I understand of your description of your situation, no, it won't fire for c_total_qty changes.

As for a work around, I guess the question is whether the root of the change is in a UI data entry or a programmatic value change. If this is a UI change of one of the root values, you can still hook in ItemChanged, but look for the root column being changed. If it's a programmatic change, I'd probably create a custom user event and call it from wherever the root value is being programmatically changed. (In fact, I'd probably recommend a custom user event in both cases, calling the custom user event from ItemChanged in the first case, so that you're ready to handle both situations cleanly.)

Good luck,

Terry.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜