This tutorial expands on the Introducing
EGL tutorial by teaching you more advanced uses of EGL and JSF.
In this tutorial, you create two pages that allow a user to search
a database in different ways.
These pages accept input from the user, search the database
for records that match the input, and display the results on the same
page. This is not the only way or the best way to create a search
page, but this way illustrates several important EGL and JSF concepts.
The
search pages you create in this module are very different from web
search engines or pages that search the Internet or a single web site.
The search pages you create in this module search for database records,
not for web pages or information on web pages.
Learning objectives
In
this tutorial, you learn how to do these tasks:
- Use SQL statements to filter results for a search page
- Create a customized EGL record part and display it on a page
- Populate a JSF combo box with dynamic data
- Apply type-ahead support to an input control
Time required
This tutorial should take
approximately 90 minutes to finish. If you explore other concepts
related to this tutorial, it could take longer to complete.
Tutorial application
When you are finished
with the tutorial, you will have a search page that can take input
from users, compare it against the data in a database, and return
results to the user. You will learn how to create a search that uses
two parameters simultaneously (an AND search); you will also learn
to change that search to one that uses one or the other of the two
parameters (an OR search) and you will place a radio button group
on the page to allow the user to choose between types. You will also
learn how to limit the user's choice of search parameters by placing
a combo box on the page; this presents a list of selections to the
user instead of allowing them to type in a string. Finally, you will
learn how to customize the search results, combining fields and determining
how the output appears on the page.
The first completed search page
will look like this:
The second
search page you will create demonstrates some simple uses of AJAX
functionality with EGL. One common used of AJAX is to provide suggestions
for user input as type-ahead support. In this way, the
page searches the database for items similar to what the user has
already typed in an input field:
Once the user has accepted one of
the suggestions, the page will use another AJAX request to display
the database information without reloading the page: