TextControl.Web: Determine when a Document Has Been Completely Loaded
Web.TextControl provides an event that can be used to determine when the ribbon bar has been loaded completely in order to add and remove ribbon items such as groups, tabs and buttons. But when implementing your own file management, it is also very helpful to know when a document has been loaded completely in order to enable or disable specific buttons. Therefore, the opened wait dialog and the registered waitDialogMessageReceived event can be used:…

Web.TextControl provides an event that can be used to determine when the ribbon bar has been loaded completely in order to add and remove ribbon items such as groups, tabs and buttons.
But when implementing your own file management, it is also very helpful to know when a document has been loaded completely in order to enable or disable specific buttons. Therefore, the opened wait dialog and the registered waitDialogMessageReceived event can be used:
<script type="text/javascript">
document.addEventListener("waitDialogMessageReceived", waitDialogHandler);
function waitDialogHandler(e) {
var msg = e.detail;
if (msg.hasOwnProperty("show")) {
if (msg.show == false) {
// your code here
alert("Loaded!");
}
}
}
</script>
The event is raised twice: At the beginning and at the end of a loading process. The show property is true when a document loading process is started and false when the document has been loaded completely.
Happy coding!
Related Posts
ASP.NETJavaScriptDocument Editor
Detect Toggle Button Changes Using a MutationObserver
This article shows how to detect changes of toggle buttons in the ribbon of the web editor using a MutationObserver. The state of a toggle button in the ribbon visualizes the state of a certain…
TextControl.Web: Adding Custom Ribbon Tabs
In recent blog entries, we explained how to add custom buttons or ribbon groups to the ribbon bar. This article shows how to add complete ribbon tabs to the existing ribbon bar of Web.TextControl.…
Building a Touch-enabled Button Bar with Javascript
A ribbon bar is a user-friendly interface for desktop environments when users can utilize a mouse to navigate. On tablets or smart-phones, another, more touch-enabled, interface might be required.…
TextControl.Web: Inserting Merge Fields Using Javascript
In a recent post, we already introduced the hidden Javascript interface that is available in version X12. This interface gives you access to the majority of internal Javascript calls that are used…
Create a Table of Contents in Windows Forms using C#
This article explains how to create a table of contents in Windows Forms using the ribbon or programmatically. Creating a table of contents is required to organize large documents.