Products Technologies Demo Docs Blog Support Company

Sneak Peek X15: Custom Field Overlays in HTML5-based Text Control

A highly requested feature for our HTML5-based Web.TextControl is the ability to show field overlays or custom elements such as HTML form elements on top of all types of fields. In version X15, fields provide it's location using the bounds property that can be used to render a custom overlay at this location. The following screen video shows a sample implementation of these custom overlays: The pop-up overlay can be used to display the field name and specific properties of a merge field.…

Sneak Peek X15: Custom Field Overlays in HTML5-based Text Control

A highly requested feature for our HTML5-based Web.TextControl is the ability to show field overlays or custom elements such as HTML form elements on top of all types of fields.

In version X15, fields provide it's location using the bounds property that can be used to render a custom overlay at this location. The following screen video shows a sample implementation of these custom overlays:

Sneak Peek X15: Custom field overlays in HTML5-based Text Control

The pop-up overlay can be used to display the field name and specific properties of a merge field. Additionally, a button has been added to open a field properties dialog directly from the overlay.

The textFieldEntered event returns the TextFieldEventArgs object that contains the bounds property (in version X15):

function textFieldEnteredHandler(e) {
    _fieldBounds = e.bounds;
    _fieldName = e.fieldName;
    _fieldParameters = e.parameters;
    drawOverlay();
}

Based on the relative bounds location and the text view offset location, the position of the field relative to the Web.TextControl can be easily calculated and used to display any overlay at that location. By listening on the zoomFactorChanged and textViewLocationChanged events, the layover can be also moved when the document is scrolled and zoomed.

This concept can be used for many different applications including the rendering of form elements on top of MS Word form fields and content control fields. All of these fields are accessible in version X15 using the new TXTextControl.getTextFields method that returns an ApplicationField object. This allows the development of MS Word compatible form completion applications based on Web.TextControl.

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Also See

This post references the following in the documentation:

  • Javascript: TextViewLocationChangedEventArgs Object
  • Javascript: TXTextControl.getTextFields Method
  • Javascript: ZoomFactorChangedEventArgs Object
  • TXTextControl.Web.TextControl Class

Reporting

The Text Control Reporting Framework combines powerful reporting features with an easy-to-use, MS Word compatible word processor. Users can create documents and templates using ordinary Microsoft Word skills. The Reporting Framework is included in all .NET based TX Text Control products including ASP.NET, Windows Forms and WPF.

See Reporting products

Related Posts

ASP.NETReportingMVC

MVC NuGet Packages for X18 Published

We just published the NuGet packages for the latest version X18 of TX Text Control .NET Server.


HTML5MVCRelease

Sneak Peek X15: Copy to Local Clipboard Support in ASP.NET Version

The HTML5 based editor for ASP.NET MVC and Web Forms (AJAX) provides access to two different clipboards: The server-side clipboard uses the internal TX Text Control format and allows to copy and…


CloudReportingDocument Viewer

New ASP.NET MVC DocumentViewer Rolled out to the ReportingCloud Portal

We just rolled out a new ASP.NET MVC DocumentViewer to the ReportingCloud portal to preview templates in the template storage. The following screenshot shows the viewer inside the ReportingCloud…


ReportingGitHubHTML5

Updated MVC Sample: Loading Files from the Backstage Menu

We just updated the very popular sample Loading files from the backstage menu to TX Text Control version X14 (24.0) on GitHub. This sample shows how to replace the file menu with an MS Word-style…


ReportingMVCRelease

Updated TXTextControl.Web MVC NuGet Package

After Service Pack 1 for TX Text Control X13 has been released, we also updated the TXTextControl.Web MVC NuGet package that is now on version 23.0.304.500. The new package contains fixes and…