当前位置: 代码迷 >> PB >> PB WEBFORM中不支持单行文本框中的pbm_enchange事件?该如何处理
  详细解决方案

PB WEBFORM中不支持单行文本框中的pbm_enchange事件?该如何处理

热度:89   发布时间:2016-04-29 09:39:32.0
PB WEBFORM中不支持单行文本框中的pbm_enchange事件?
请问:
单行文本框中自定义的pbm_enchange事件代码不会执行。
如果改成dw里的editchanged事件也不会执行。
有什么办法替代吗?

万谢。。。

------解决方案--------------------
pb的webform不支持事件ID关联的自定义事件,另外,还有下列不支持的事件
而且做为web,除非你能很好地使用ajax,否则不建议使用类似于增量检索这类的,交互次数与程序性命攸有关
 Custom events Custom events based on PowerBuilder Message (pbm) event IDs are not supported in Web Forms applications. However, you can call user-defined events without event IDs using the TriggerEvent and PostEvent functions.

Table 8-8: Unsupported events by control in Web Forms projects Event Controls 
BeginDrag All controls 
BeginLabelEdit ListView, TreeView 
BeginRightDrag All controls 
Clicked DatePicker, MonthCalendar 
(supported for DataWindow, but not triggered on editable controls that already have focus) 
CloseUp DatePicker 
Deactivate Window 
DeleteAllItems ListView 
DoubleClicked DatePicker, DropDownListBox, DropDownPictureListBox, HProgressBar, ListBox, MonthCalendar, RichTextEdit, Tab, VProgressBar, Window (supported for other controls, but the Clicked event is not triggered on a double-click in a Picture or StaticText control) 
DragDrop All controls 
DragEnter All controls 
DragLeave All controls 
DragWithin All controls 
DropDown DatePicker 
EditChanged DataWindow 
EndLabelEdit ListView, TreeView 
FileExists RichTextEdit 
GetFocus All controls 
Help All controls 
Hide Window 
HotLinkAlarm Window 
InputFieldSelected RichTextEdit 
ItemActivate ListView 
ItemChanged DataStore 
Key All controls 
LoseFocus All controls 
MouseDown RichTextEdit, Window 
MouseMove RichTextEdit, Window 
MouseUp RichTextEdit, Window 
Notify TreeView 
Other All controls 
PrintEnd DataWindow 
PrintMarginChange DataWindow 
PrintPage DataWindow 
PrintStart DataWindow 
RButtonDown MultiLineEdit, SingleLineEdit, HScrollBar, VScrollBar 
RButtonUp RichTextEdit 
RemoteExec Window 
RemoteHotLinkStart Window 
RemoteHotLinkStop Window 
RemoteRequest Window 
RemoteSend Window 
RightClicked ListView
RightDoubleClicked All controls 
ScrollHorizontal DataWindow 
ScrollVertical DataWindow 
Selected Menu 
Sort ListView, TreeView 
SystemKey Window 
ToolbarMoved Window 
ValueChanged DatePicker 

Partially supported control events

------解决方案--------------------
数据窗口的editchanged事件是可以执行的,但每次都需要回调服务器端程序,效率太差了,你可以写javascript

以下是pb帮助中关于webform的介绍
Example code for an event handling script
The following is an example of a customized, client-side JavaScript event handler for the ItemChanged event of a DataWindow. The event handler determines whether the item changed is in the first or second column of the DataWindow. If the item is in one of the first two columns, this event handler calls the default JavaScript event handler that rejects item changes. In this case, the default event handler does not cause a postback. If the item changed is not in the first or second column, no client-side action is taken, and the server-side action is delayed until a postback is triggered by a different event or function call: 


 //Start MyScriptFile.js
 function MyItemChanged(sender, rowNumber, columnName, newValue)
 {
if(columnName == "column1" || columnName == "column2")
{
// The default function is invoked
return PBDataWindow_ItemChangedReject(sender, rowNumber, columnName, newValue)