You are here: COM API reference > Designer object > InitWithData method

InitWithData method

Called when an interface extension needs to display a page. The page should respond by initializing controls with data for the currently selected object.

Parameters

Client

A reference to the Meridian Enterprise host application. This object should be passed to the m_Designer.InitWithData method. There is no need to use it directly in custom code. The functionality provided by the host application is available through the GetHostService method.

Remarks

By default, m_Designer.InitWithData is invoked to initialize the data binding for the controls on the page. This code should never be removed.

Note    A page may never be shown if the user does not select the tab it is displayed on. To improve the responsiveness of the system, you may choose to delay some initialization actions until the OnShow method is called.

Following is the default extension of this method in the form templates:

Private Sub IAMExtensionPage_InitWithData(ByVal Client As Object)
    On Error GoTo Error_handler
    
    If Not m_Designer Is Nothing Then
        m_Designer.InitWithData Me, Client
        ' Todo
        ' Add your code here
    End If

    Exit Sub
Error_handler:
    MsgBox caption & " InitWithData: " & Err.Description
End Sub

Any controls on the form that provide custom functionality or are not data-bound should be initialized in this method. We recommend that you retrieve property values using either the interface extension designer or the IASDocument interfaces as demonstrated in the following sample code.

If Not m_Designer Is Nothing Then
    m_Designer.InitWithData Me, Client
    ' Todo
    ' Add your code here
    ' Set the drawing number on initialize
    ammDrawingNumber.Text = m_Designer.GetPropertyValue("","DrawingNumber", "")
End If

Related information

IAMUIExtensionDesigner object

IAMExtensionPage interface

Accessing properties using the designer object

Accessing properties using the IASDocument interface

About manual vs. automatic data binding

ApplyChanges method

ReleaseData method


www.bluecieloecm.com