Working with EAServer components

After you define an EAServer profile in PowerBuilder, the 4GL JSP Page wizard and the Components tab of the System Tree list the components available on the server. You can select components in the wizard, or drag components from the System Tree to your page to give your page access to the components.

Making properties of EAServer components available for binding

Providing page access to a component lets you use it for data binding. Data binding lets you bind a property of an EAServer component to a page control, associating the control with the property value.

Properties available for binding comprise a standardized set of set and get methods. In general, components are available for binding if they display a get method that does not require arguments.

For example, the picture that follows is part of a System Tree display of components on an EAServer server:

Shown is part of a System Tree display of components on an EAServer server. Under E Music J, the expanded Artist component shows many methods without arguments such as get Info ( ) and one method called set Session Context, with the argument Context.

The Artist component has a getInfo method that does not have any arguments. That means that if you add the component to your 4GL JSP page, the Info property of the Artist component is available for binding to controls on the page.

The 4GL JSP Page wizard lets you select components to add to your page. You can also defer adding components until after the page is created.

StepsTo make properties of EAServer components available for binding:

  1. Drag an EAServer component from the Components tab of the System Tree to the Page view of a 4GL JSP page in the HTML editor.

    NoteStart EAServer The server must be running before you can see the server components in the System Tree.

    The EAServer page of the Page Properties dialog box displays. This page supplies the component name, a default variable name (based on the component name), and a default scope (page) for the variable.

    Shown is the E A Server tab page of the Page Properties dialog box. It has columns for Component Name, Variable Name, Life Time, and Session Name and a sample entry called E Music / Artist with Variable Name Artist and a Life Time of page.
  2. Change any of these values as needed and click OK.

    Now the variable representing the component is available to your page.

For information about binding controls to EAServer component properties, see “Binding controls to properties of EAServer components”.

Getting information about EAServer components

After your page has access to an EAServer component, you can display information about the characteristics of that component on the Page tab of the System Tree (as well as on the Components tab). You can find the component under the EAServer Objects branch of the Server Side node of the Page tab. The Properties menu item on the pop-up menu for the component displays the properties of the component.

NoteDrag and drop from the Page tab If you drag an EAServer component from the Page tab of the System Tree to the integrated Script editor or the Source view, the name of the component is added to the open script or the source code. The Page Properties dialog box does not display as it does when you drag and drop the same component from the Components tab to the Page view.