Explore the event handling in Lotus forms, part II

Source: Internet
Author: User
Tags extend xform

Xform forms support for functions and event handling functions

Lotus forms manages business processes by building dynamic electronic forms, collecting user information and passing it to other application systems. In contrast to paper forms, one of the biggest advantages of XForm electronic forms is the ability to respond dynamically to user activities. For example, dynamically changing the background color according to user input, responding to mouse click events, sending a message or submitting a form, and so on. This article will give you detailed information about the event-handling mechanism in Lotus forms, including the main events, activities, and functions supported by the XForm form, through several examples. In this article, you will be able to flexibly use the Lotus Forms Designer to build rich, intelligent electronic forms.

Brief introduction

In the first part of this series, we give you a detailed overview of the XFDL form's support for computing functionality. By introducing the calculation, the XFDL form can make a complex response to the user's activities, which provides a powerful function for the event processing in the form. In order to construct complex computations, we inevitably need to use some of the predefined functions provided by the XFDL language to achieve specific functions.

The whole article mainly contains the following content: The second part gives a brief introduction to the descriptive language (XFDL) used in the Lotus forms form to better understand the sample form code referenced in this article; The second section discusses the main function support provided for form design in Lotus forms; in Part Three , we'll delve into the support for event and activity processing in the Lotus forms form. The last part is the concluding remarks.

Building a dynamic electronic form-function

Functions are predefined computing functions in XFDL languages that can help XFDL forms implement complex operations, which often require complex computational expressions to complete. In the previous section, we've covered the invocation of simple functions, which are functions provided by XFDL itself, called standard functions. In addition, you can write functions yourself or introduce functions from outside, and we call these functions custom functions or extensions. For the use of standard functions, you can refer to the XFDL specification, which includes very detailed function definitions, examples of usage, and issues to be noted, which we do not present here. In this section, we'll provide you with an example of how to customize your own functions to extend the functionality of the form.

Custom functions can be written in the C or Java language. In this section, we'll show you how to develop Java custom functions through an example of a SayHello function. Before you begin developing custom functions, you must first install the IBM Lotus Forms Server–api, and refer to the relevant content on information Center for installation steps and specific configurations. In this set of APIs, a function call interface (FCI) library is included, which provides a set of functions to help users develop custom functionality to extend the form's functionality. The extensions in this article are very simple, just receive a string (XX) and return another string (Hello xx). The specific development process is as follows:

To create an extension class

When the XFDL form is initialized, the API checks for the current extension and, if it does, calls the initialization method of the appropriate extension class to complete the registration of the extended functionality. Therefore, we first need to create an extension class and implement the initialization method therein.

1. In package com.ibm.sample, create a new Java source file Formfunctionextension.java and import the required class files. As you can see from the following code, the class inherits the Extensionimplbase class and implements the Extension interface. Where the initialization method Extensioninit has a IFX type of parameter ifxmgr, as IFX Manager.

Listing 1. Formfunctionextension.java Program

package com.ibm.sample;
import com.PureEdge.ifx.IFX;
import com.PureEdge.ifx.ExtensionImplBase;
import com.PureEdge.ifx.Extension;
import com.PureEdge.xfdl.FunctionCall;
import com.PureEdge.xfdl.FunctionCallManager;
import com.PureEdge.xfdl.FormNodeP;
import com.PureEdge.IFSUserDataHolder;
import com.PureEdge.error.UWIException;
public class FormFunctionExtension extends ExtensionImplBase
implements Extension{
public void extensionInit(IFX IFXMgr) throws UWIException {
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.