Nintex Forms Life Cycle
This topic describes the steps and events in the Nintex form instance.
Form Filler Class
The Forms filler renders the form within the context of SharePoint. For example, when a user opens a SharePoint list, a form can be triggered to open. The Forms filler reads the form XML and interacts with SharePoint to connect the user interaction, event model, and data with the list.
The life cycle is a sequence of event handlers raised in the time line of a form. The server side event binding is handled by the FormFiller class in the Form.Nintex library. The class in turn communicates with the FormFiller.JS, which handles the rendering of the form in the client.
The Forms filler contains:
- The Forms Filler Class (formsfiller.cs)
The .Net class handles the connection to the server side event and data binding. For more information see Form Filler Life Cycle Events.
- The Forms Filler JavaScript Libary (formsfiller.js)
Formsfiller.JS handles the rendering of the form and form controls in the client. For more information about the Forms Filler rendering see Forms Filler.
When a form runs, the form goes through a life cycle in which it performs a series of processing steps. These include initializing, instantiating controls, restoring and maintaining state, running event handler code, and rendering. It is helpful to understand the page life cycle so that you can write code at the appropriate life cycle stage to meet your requirements. Within each stage of the life cycle of a Nintex form, the page raises events that you can handle to run your own code.
If you create custom controls, your base class will handle the control in the context of the life cycle in order to initialize the control, populate the control properties with view state data, and run control behavior code. The life cycle of a control is based on the page life cycle, and the page raises many of the events that you need to handle in a custom control.
Understanding the life cycle will help in identifying which events might be used to fire JavaScript code to accomplish your form customizations. You can find more information on the discussion of events at Nintex Forms Events.
Form Filler Life Cycle Events
Events in the FormFiller class are mostly derived from the Control class in System.Web.dll or are delegates of the CommandEventHandler of the System.Web.dll. The delegates handle button control events.
For a discussion of using events see "Handling and Raising Events" on MSDN.
Cancel
The Cancel event uses the CommandEventHandler delegate from the System.Web.UI library in the .NET Framework.
The event occurs when the form button triggers the cancel event. The event takes the parameter containing the event data.
ControlsLoaded
The ControlsLoaded event is inherited from the WebControl class in System.Web.UI in the .NET Framework. An override of the LoadViewState.
The event occurs when the Forms filler loads the form controls. Restores view-state information from a previous request that was saved with the System.Web.UI.WebControls.WebControl.SaveViewState method. The event takes an object that represents the control state to restore.
DataBinding
The DataBinding event is The DataBinding is inherited from the Control class in System.Web.UI in the .NET Framework. The event occurs when the server control binds to a data source.
Disposed
The Disposed event is inherited from the Control class in System.Web.UI in the .NET Framework. The event occurs when a server control is released from memory, which is the last stage of the server control life cycle when an ASP.NET page is requested.
Init
The Init event is inherited from the Control class in System.Web.UI in the .NET Framework.
The event occurswhen the server control is initialized, which is the first step in its life cycle. Server controls should perform any initialization steps that are required to create and set up an instance. You cannot use view-state information within this event; it is not populated yet. You should not access another server control during this event, regardless of whether it is a child or parent to this control. Other server controls are not certain to be created and ready for access.
Load
The Load event is inherited from the Control class in System.Web.UI in the .NET Framework.
During load, if the current request is a post back, control properties are loaded with information recovered from view state and control state.
PreRender
The PreRender event is inherited from the Control class in System.Web.UI in the .NET Framework.
The event occurs after the Control object is loaded but prior to rendering. Use this event to perform any updates before the server control is rendered to the page. Any changes in the view state of the server control can be saved during this event. Such changes made in the rendering phase will not be saved.
Save
The Save even uses the CommandEventHandler delegate from the System.Web.UI library in the .NET Framework.
The event occurs when the form button triggers the save event. The event takes the parameter containing the event data.
SaveAndSubmit
The SaveAndSubmit event uses the CommandEventHandler delegate from the System.Web.UI library in the .NET Framework.
The event occurs when the form button triggers the Save and Submit event. The event takes the parameter containing the event data.
Unload
The Unload event is inherited from the Control class in System.Web.UI in the .NET Framework.
The event occurs when the server control is unloaded from memory. Server controls must perform any final clean-up, such as closing files, database connections and discarding objects, during this stage of the control life cycle before the instance is unloaded.