WebLoader Component

Using the form.suite4.net FormDatabase component, existing forms can be dynamically loaded and used in both Web and Windows environments. For web pages, this functionality is achieved by taking advantage of Macromedia ® Flash™ technology. This allows for constistent and predictable rendering of forms across client browsers and operating systems that have Flash Player 7.0 and higher installed.

The WebLoader component is essentially a Flash (.swf) file that is able to dynamically display a form that has been created in the form.suite4.net application. It queries an XML Web Service on the server for data on the form to be displayed and draws it accordingly. The Web Service, in turn, receives the form information from the form.suite4.net project file that has been placed on the server, as depicted in the following illustration:

The form layout is created in the form.suite4.net designer using the tools available there. After the project file has been placed on the server, the Web Service can extract all the necessary information from it to display the form on a web page. When you make changes to an existing form in the form.suite4.net designer, they will immediately be visible to Web site visitors after the updated project file has been placed on the server. No HTML knowlege is required, visual updates only occur in one place — the form.suite4.net designer.

Communication between the WebLoader and its Web Service is achieved through the use of WebLoaderEvents. You can pass parameters to the Web Service and query it for business data or use it to change the form's user interface language. The IForm interface of the FormDatabase assembly contains methods to serialize and deserialize a form and its associated business object for smooth interaction with the Web Service.

If a form includes images, the WebLoader component will extract them from the form and display them in the Flash player. This allows for the creation of visually rich user interfaces for Windows and the Web.

Configuring WebLoader events

WebLoader events are configured on the client and handled on the server or client, depending on the configuration. The first step is to enable an existing form for use with the WebLoader component by selecting the form in the Project Explorer of the Form Manager and activating the checkbox "WebLoader enabled" as shown on the right.

Next, open the form in the Form Designer and select the control on the form which you want to associate the event with. In most cases, this will be a command button. Because the form has been enabled for use with the WebLoader in the previous step, an additional panel is displayed that allows you to configure the WebLoader event according to your needs. The panel is shown on the left.

The value selected in the "EventType" dropdown-list determines where the event will be handled — if it's set to "WebService" a server-side method will be called, whereas setting it to"JavaScript" will have the WebLoader look for and call a client-side JavaScript function.

Note that the values of most of the available parameter types in the "WebLoader Events" panel are provided by the system. For example, you do not have to provide an explicit value for "FormName", as the WebLoader will automatically pass this value to the configured event handler method. Only setting the parameter type to "UserDefined" enables the textbox for providing a custom parameter value as shown in the screenshot above.

Debugging the WebLoader

Flash Player is highly tolerant of errors by design, so you may need a "window" into what's going on in the WebLoader during development and/or testing as you will not get any error messages from the player itself. The component provides three configurable levels of debugging:

The debug levels are set as parameters of the <object> tag on the Web page that hosts the WebLoader component.