Binding functions and variables from a service to controls
on a web page is no different from binding any other type of functions
and variables, but EGL provides shortcuts for working with service
controls in this way.
This task has the following prerequisites:
- An EGL web project and web page.
- A service binding.
To bind functions and variables from a service to fields on a web
page:
- Open the web page in the editor.
- From the EGL drawer of the Palette view, drag a Service onto
the page. The Add Service window opens, listing all the services for
which you have defined client bindings.
- In the Add Service window, select the service that you want to
use in the Select a service list. The Select
a function list shows the functions that are available
in this service.
- Under Select a function, select the function
that you want to use. You can select more than one function by pressing
and holding Ctrl and clicking the functions.
- Click Finish. The Page Data view now shows
the service in its Services folder, and variables
and functions are added to the JSF Handler.
From this point you
can add controls and buttons to the page just as in Binding a control on a web page to a variable and Binding a JSF button to a function, but the entry for
the service in the Services folder enables
you to create all the controls that are needed for the service at
once.
- From the Services folder of the Page Data
view, drag the service onto the page. The Insert Service window opens.
- In the Function list, select a function
to use on the page.
- Under Fields to display, set the options
for the input controls.
- Click Next.
- On the Results Form page, set the options for the output controls.
- Click Finish.
The controls for input and output and buttons to invoke the function
are added to the page and bound to the corresponding variables and
functions in the JSF Handler.