hub.eb?material_id=294&track_id=309

Introducing Client-Side Events


Client-side events are driven by the browser in response to user interaction with the page, for example, hover and mouseover events.

Client-side event handlers can be written to respond to these types of events. These event handlers are written in JavaScript in the HTML Element Properties of a Control.

The Client Event Map shows all the event handlers currently configured on your Page, usually you'll find it underneath the Entities tree or by choosing Show/Hide Client Event Map from the View menu.

The HTML Element Properties can be accessed by:

  • Right-clicking a Control and selecting HTML Element Properties.
  • Selecting a Control and pressing Ctrl + H.
  • Clicking the button on the  HTML Element Properties property of a Control.
  • Double-clicking on an event in the Client Event Map.

HTML Element Properties Assistant

In these handlers you can reference JavaScript libraries that you've added to your Web Resources and call server-side functions using the Client-Server API.

Steps


1

Create a Form and add a Text Control that says "Click Me" to the Page.

2

Open the HTML Element Properties dialog for the Text Control and select the HTML tab under Custom Event Handlers.

3

Select onclick from the Event dropdown.

Then double-click on the code input to open the editor and add the following code:

alert("My first client-side code");
4

Run the form and click the text.

Current Module

Part of tracks

Related