Products Technologies Demo Docs Blog Support Company

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

TX Text Control X15 introduces a bounds property on fields in Web.TextControl, returned through the textFieldEntered event. Developers can position custom HTML overlays at field locations to display merge field names, open property dialogs, or render form elements over fields.

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

TX Text Control X15 introduces local clipboard support for the HTML5 ASP.NET editor. A toggle switches between the server-side clipboard with full formatting and the client-side HTML clipboard.…


CloudReportingDocument Viewer

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

The ReportingCloud portal now features an ASP.NET MVC DocumentViewer for previewing stored templates. It loads pages asynchronously, displays thumbnail navigation in a sidebar, supports text…


ReportingGitHubHTML5

Updated MVC Sample: Loading Files from the Backstage Menu

The ASP.NET MVC backstage menu sample has been updated to TX Text Control X14 with the latest NuGet packages. The backstage view replaces the default file menu with a customizable, MS Word-style…


ReportingMVCRelease

Updated TXTextControl.Web MVC NuGet Package

TXTextControl.Web MVC NuGet package updated to 23.0.304.500 with X13 Service Pack 1. Fixes address ReadAndSelect edit mode formatting, iOS virtual keyboard input since 9.2, and symbol insertion in…

Share on this blog post on: