Show TOC

Background documentationCustom Events Locate this document in the navigation structure

 

You can trigger events, either client or server side, using the standard Enterprise Portal Client Framework coding. The following are examples:

  • Client Side: When creating the UI for a pane, call setOnClientClick() on an HTMLB button control and pass the name of a client-side JavaScript function. This function is called when an administrator clicks the button.

    Syntax Syntax

    1. paymentTypeButton.setOnClientClick("alertSubmit()");
    End of the code.
  • Server Side: A server-side event can be triggered in the following ways:

    • When creating the UI for a pane, call setOnClick() on an HTMLB button control and pass the name of a server-side event. A server-side event is triggered when an administrator clicks the button.

      Syntax Syntax

      1. paymentType.setOnClick("coordPayType");
      End of the code.
    • Create a custom toolbar button, as described in Step 1: Creating Panes. A server-side event is triggered when an administrator clicks the button.

    • Call raiseServerEvent() from JavaScript code.

      Syntax Syntax

      1. function callServerEvent() {
           raiseServerEvent("myServerEvent");
        }
        
      End of the code.
Capturing Events

Server-side events can be captured by the following:

  • Event Handler Method: You can create a method to be executed when a server event is triggered. For an event called event, doEvent() is called.

    An event is captured in the same pane in which it was triggered.

  • Editor Pane: You can specify that an editor pane be displayed whenever a server-side event is triggered. This provides a way for an editor to navigate between panes without the user selecting a pane radio button.

    To specify a pane to be displayed for a server-side event, call setActivatingEvent() on the pane object and specify the event that triggers the editor to navigate to that pane. This is done in the editor component's setupEditor() method.

    For example, the following specifies that the personalDetails server-side event triggers the editor to navigate to the personalDetails pane:

    Syntax Syntax

    1. personalDetailsPane.setActivatingEvent("personalDetails");
    End of the code.