onConstructionFunction

The onConstructionFunction JSF handler property specifies a function within the JSF handler that runs when the page is first constructed. (This property was formerly known as onPageLoadFunction.) More accurately, the function runs when the page bean (representing the JSF handler in the web server) is instantiated (created).

The specified function runs when another JSF handler or program forwards control to the JSF handler. This function does not run again if the JSF handler forwards control to itself or if a function within the JSF handler ends without issuing a forward statement.

Compare with the following related properties:

If you specify parameters for any of the functions these properties refer to, you must specify the same parameters for all of the functions.

If you use session scope and set cancelOnPageTransition to NO, JSF places the handler in session, where it will stay until it times out or the session ends. The handler can contain data for unused fields, or other unnecessary information. You might be able to save memory by doing the following:

You can explicitly remove a page from session scope with the j2eeLib clearSessionAttr() and clearEGLSessionAttr() functions (see clearSessionAttr() and clearEGLSessionAttrs()).

Limitations

Example

The following example shows the property in the context of a JSF Handler part:

Handler  handler01  type JSFHandler
        { onConstructionFunction="resetVars" }
  ...
  Function resetVars()
     ...
  end
end

Compatibility

Table 1. Support for onConstructionFunction property
Data item JSF handler VGUI record Console UI Text Form Java™ Text Form COBOL Print Form Java Print Form COBOL
No Yes No No No No No No

Feedback