• InfoPath窗体事件列表说明和示例使用


    InfoPath窗体事件列表说明和示例使用

    一、事件列表:

    Name

    Event handlers

    Description

    DataDOMEvent object

    OnBeforeChange

    OnValidate

    OnAfterChange

    Returns a reference to a form's underlying XML document, the return status, and other properties that contain information about the XML node during an XML Document Object Model (DOM) change. Also includes a method for raising an error.

    DocActionEvent object

    OnClick

    Returns a reference to a form's underlying XML document, the return status, and the source XML node during a button click in the form area.

    DocContextChangeEvent object

    OnContextChange

    Returns information about the XML Document Object Model (DOM) node that is the current context of the form's underlying XML document.

    DocEvent object

    OnSwitchView

    OnAfterImport

    Returns a reference to a form's underlying XML document during a switch view or form merge operation.

    DocReturnEvent object

    OnLoad

    OnSubmitRequest

    Returns a reference to a form's underlying XML document and the return status during the loading or submission of a form.

    MergeEvent object

    OnMergeRequest

    Returns properties and methods that can be used during an OnMergeRequest event to programmatically interact with a form's underlying XML document and to determine merge properties such as the number of files being merged.

    SaveEvent object

    OnSaveRequest

    Returns a number of properties and methods that can be used during a save operation from the OnSaveRequest event handler to programmatically interact with a form's underlying XML document, determine save properties, and perform the save operation.

    SignEvent object

    OnSign

    Used to add additional data to the digital signature.

    VersionUpgradeEvent object

    OnVersionUpgrade

    Returns a reference to a form's underlying XML document, the return status, and the document and solution version numbers during the version upgrade operation.

    二、使用示例:

    //=======

    // The following function handler is created by Microsoft Office InfoPath.

    // Do not modify the name of the function or the name and number of arguments.

    //=======

    function XDocument::OnLoad(eventObj)

    {

       // Write your code here.

    }

    function msoxd__myField_attr::OnBeforeChange(eventObj)

    {

       // Determine whether there is a new value.

       if (eventObj.NewValue == "")

       {

          // The value is blank, so display an error message and roll back the changes.

          eventObj.ReturnMessage = "You must supply a value for this field.";

          eventObj.ReturnStatus = false;

          return;

       }

    }

  • 相关阅读:
    (转)学习笔记viewController(欢迎指错)
    配置Xcode版本控制SVN详细步骤内含解决Xcode/Mac OS10.8无法配置SVN的解决方法(转)
    iPhone 3G/3GS(有锁)基带与导航功能
    [转]Iphone 3G/3Gs Home键失灵的根本原因和解决方法
    NSDate的常用用法(转)
    短信操作(转)
    如何在Symbian SDK下使用GCCE4(转)
    nS60_sdk_v1_2的VC6问题(转)
    如何获取应用程序图标(转)
    如何实现圆角的UITextView iphone短信发送(非系统界面)
  • 原文地址:https://www.cnblogs.com/xh831213/p/470992.html
Copyright © 2020-2023  润新知