Forms Processing Emergence - JavaScripted | 2

Forms Processing Emergence - JavaScripted

The omission of XForms was predicated on the two unique features of InfoPath that make it very attractive for forms processing. First, there is the conditional formatting capability which shows/hides portions of a form depending on what data a user has entered or what buttons were clicked. Second, there is the ability to expand sections of a form with repeating fields. The classic example is a Travel Expense Items form which starts with only 2 rows of expense fields but allows users to add more rows with a simple rightmouse click on a button which automatically adds the new row and expands the whole electronic form if necessary.

The InfoPath Forms designer and Script debugger (all the examples in a Jan 2004 Redmond webcast were done in JScript though VBScript is supported) look like chips off of the Visual Studio block – very polished. However, the underlying InfoPath form is stored in XML, a direction that the new Longhorn is going in but significantly different from ASP WebForms, Access Forms, and Visual Studio WinForms. This is a drawback to InfoPath because this generally non-interoperable Windowing options will have to be settled pre-Longhorn or sooner. But the Forms Designer is quite robust in the type of elements and components it supports, such as text box and rich textareas, dropdown lists, checkbox and radio buttons, data access-driven labels, optional/repeating sections, image and ink picture upload fields, and more. These basic controls go well beyond those available in HTML and even basic XForms. But curiously, despite support for CSS and improvements in Windows Media Player contents and compression - neither audio nor Video are allowed in InfoPath forms. This puts InfoPath at a disadvantage, compared to Adobe Acrobat Forms.

However, InfoPath now offers data connectivity which is soon to be delivered in Acrobat and has more features than that provided by most XForms based tools. In addition, the connectivity to XML sources is quite robust using either XSD or basic .XML data files as templates to drive form design. For example, when creating a new RSS form, I simply pointed to an existing RSS XML file, then InfoPath checked for well-formedness and used the fields in the file as data sources in the forms designer. I could even use the existing data in the form to check for good layout and styling. In addition to XML data sources, users can use XML Web Services to connect to a multitude of backend databases and application servers (lots of non-Microsoft applications are accessible through a wizard guided setup). Unfortunately, the ADO connection is restricted to just SQL Server and Access. Overall a positive message about data sourcing is marred by a case of Microsoft myopia.

With programming support the message is pretty good. Almost all of the examples and demos use Jscript (Microsoft's version of JavaScript which is also ECMAScript 262 compliant). VBScript also works and a free upgrade will be available which will
allow VB.NET and C#.NET to be used instead of JScript. As an Office 2003 application, InfoPath can also be programmed in VBA but there is a restriction - only the form filler routines and methods are exposed for programming. All the Forms Design and validation richness is hidden for now. Also, unfortunately, there is not a "free" InfoPath form filler application available. Users must have access to the full package (though its Form design features can be disabled by IT administrators). Finally, because of a lack of multimedia/cross browser support, a low cost form filler and poor cross-platform deployment (this is a Windows 2000 and XP only app), InfoPath is behind Adobe's XDP Acrobat. In fact, this application underlines the wasted opportunity to split Microsoft into separate OS and Office companies after the Antitrust action. In a separate OfficeSoft company, InfoPath would run in Mac and Linux as well as most flavors of Windows, would utilize SVG and SMIL, would run in any browser, and support any ODBC and JDBC data sources. InfoPath could be a killer application.

XForms Software

As previously noted, despite the fact that XForms has taken awhile to emerge, there are already a number of vendors delivering versions. Yet on the surface, if you’re an HTML Forms designer, XForms is not much of a stretch. Consider the following examples:

Classic HTML Form with one input field and one button:

<html>
<head><title>Search</title></head>
<body>
     
  <form action="http://example.com/search"      
    method="get">
Find <input type="text" name="q">
<input type="submit" value="Go">
     
  </form>      
</body>
</html>
     

XForms Implementation:

<h:html xmlns:h="http://www.w3.org/1999/xhtml"    
  xmlns="http://www.w3.org/2002/xforms">    
<h:head>      
  <h:title>Search</h:title>
<model>
     
    <submission action="http://example.com/search"      
    method="get" id="s"/>    
  </model>      
</h:head>
<h:body>
     
  <h:p>      
    <input ref="q"><label>Find</label></input>
<submit submission="s"><label>Go</label></submit>
     
  </h:p>      
</h:body>
</h:html>
     

Created: March 27, 2003
Revised: March 10, 2004

URL: URL: http://webreference.com/programming/javascript/j_s/column6/1