pfc_Validation事件编码示例

时间:2010-06-08 08:04:42

标签: events validation powerbuilder powerbuilder-pfc

您能举例说明我应该在pfc_Validation事件中编码的方式吗?这是我从未使用过的事件。例如,这是我在ue_itemchanged事件中编码的内容。

if dwo.name = 'theme' then  
   This.Setitem(row,"theme",wf_clean_up_text(data))
end if

if dwo.name = 'Comments' then  
   This.Setitem(row,"Comments",wf_clean_up_text(data))
end if

pfc_Validation事件中编码这些验证的正确方法是什么,以便它们仅在保存时执行?

1 个答案:

答案 0 :(得分:3)

你问的是本地PowerBuilder以外的东西,所以无法保证我的假设是正确的。 (例如,任何人都可以创建一个pfc_Validation事件,并在用户使用鼠标绘制圆圈时触发) 一个pfc_Validation事件,编码为PowerBuilder Foundation Classes中逻辑工作单元(LUW)服务的一部分(PFC)。如果你想了解更多相关内容,我已经在LUW上写了an article

首先,你的问题是:LUW服务中的所有东西都只是在节省时间被解雇,所以你在那里很好。

话虽如此,从代码的外观来看,这不是验证,而是更新的数据准备。在此基础上,我建议这个逻辑的适当位置是pfc_UpdatePrep。

至于转换代码,它非常简单。 (现在,看着我搞砸了。)

FOR ll = 1 to RowCount()
   Setitem(ll,"theme",wf_clean_up_text(GetItemString (ll, "theme")))
   Setitem(ll,"comments",wf_clean_up_text(GetItemString (ll, "comments")))
NEXT
祝你好运,

特里。

相关问题