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.…

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. 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.
Also See
This post references the following in the documentation:
- Javascript: Text
View Location Changed Event Args Object - Javascript: TXText
Control.get Text Fields Method - Javascript: Zoom
Factor Changed Event Args Object - TXText
Control. Web. Text Control Class
Jump to the other posts in this series:
- Sneak Peek X15: UI Automation Interface for TX Text Control .NET for WPF
- Sneak Peek X15: Watermarks and Objects in Headers and Footers Behind the Main Text
- Sneak Peek X15: Ribbon Chart Layout Tab
- Sneak Peek X15: Custom Field Overlays in HTML5-based Text Control
- Sneak Peek X15: Copy to Local Clipboard Support in ASP.NET Version
- Sneak Peek X15: Contextual Chart Ribbon Tabs
- Sneak Peek X15: Add Formatting Using the Mini Toolbar
- Sneak Peek X15: Keeping Table Rows Together
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.
Related Posts
MVC NuGet Packages for X18 Published
We just published the NuGet packages for the latest version X18 of TX Text Control .NET Server.
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…
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…
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…
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…