End User Recipe: Search for Existing Meeting


A search page is an important component of a meeting schedule application. Employees trying to schedule a meeting can quickly review whether a particular room is open on a certain day and time or see a list of all meetings on a given day. Meeting participants might remember the name and date of the meeting but not where it is to be held.

Like almost all search applications, ours is composed of a search entry page and a results page. In the search page we are about to construct, you'll be able to search by the meeting name, owner, date, start time, or room, or any combination of these criteria. To see a list of all the meetings in the data source, all the user has to do is select the Find Meeting button without entering any criteria.

Step 1: Implement Search Page Design

The Search Existing Meetings page comprises a series of text fields, a list element, and a submit button.

1.

Create a basic dynamic page, either by hand or derived from a template.

In the ConferenceRoomScheduler folder, locate the folder for your server model and open the existingmeeting_request page found there.

2.

Add a table to the content region of your page to contain the interface elements for the application.

From the Snippets panel, drag the Recipes > ConferenceRoom > Wireframes > Search Existing Meetings - Wireframe snippet into the Content editable region.

3.

Insert a table and form to hold the various search fields. The example application includes three text fields, a list, and a submit button.

Place your cursor in the row below the words SEARCH EXISTING MEETINGS and insert the Recipes > ConferenceRoom > Forms > Find Meeting - Form snippet for your server model; to code the <form> tag properly, different snippets are available for ASP, ColdFusion, and PHP.

4.

Select the form just inserted and, from the Property inspector, set the Action parameter to your intended results page.

Click the Browse for File icon and choose the meeting_results page for your server model [r3-14].

r3-14.


5.

Be sure to save the page before continuing.

Step 2: Add Database Components

As with most similar applications, almost all the server-side logic to power the search is located in the results page. The only reason a database component is used is to populate a list element, Rooms.

1.

From the Server Behaviors panel, choose Add (+) and select Recordset (Query).

Note

This is the same recordset used on the Meeting Request and Edit Meeting Request pages. Feel free to copy the Rooms recordset from either of those pages and paste it here as previously described.

2.

In simple view, enter the name of the recordset.

Enter Rooms in the Name field.

3.

Select the data source connection.

Choose Recipes from the Connection (Data Source) list.

4.

Choose the table to work with.

Select Rooms (rooms in PHP) from the Table list.

5.

Limit your data source columns to only those that are needed.

Choose the Selected Columns option and highlight RoomID and RoomName.

It's generally considered good practice to limit your data source fields to those that are necessary. When one of the unnecessary fields is a memo type field such as RoomDescription that can hold a great deal of text, this habit is especially important.

6.

Leave the Filter option set to None.

7.

Set the Sort option to present an alphabetical listing of the rooms.

Choose RoomName from the Sort list and accept the Ascending order.

8.

Verify your choices and click OK when you're done.

Step 3: Data Binding Process

The data binding for this page is simple. All that is needed is to associate the Room list element with the Rooms recordset.

1.

Select the ConferenceRoom list element and click the Dynamic button on the Property inspector.

2.

In the Dynamic List/Menu dialog, choose Rooms from the Options From Recordset list.

3.

Set the Values list to RoomID and Labels to RoomName.

4.

Leave the Select Value Equal To field blank, and click OK to close the dialog.

You'll note that the list element already has one static entry where the value is empty and the label is Any. The empty value acts as a wildcard to allow users to search for any available rooms at a given time. Static values always appear before dynamic values.

Step 4: Add Error Messages

All the actual logic for error checking is handled on the results page. We do, however, need to embed two conditional error messages on the page. The first error message is displayed when an improper date is entered in the Meeting Date field. The other error message is used to indicate that no results were found for the submitted search criteria. By having these messages appear on the current page rather than a results page, the user can immediately try again.

1.

In Design view, place the cursor in the row above the text Search for Meeting Name, Owner, Date and/or Conference Room.

2.

Insert the following code:

From the Snippets panel, open the Recipes > ConferenceRoom > Custom Code folder for your server model and insert the Date Error - Dynamic Text snippet.

[View full width]

<% if (cStr(Request.QueryString("badDate")) <> "") Then Response.Write("The date you entered was not in the proper format. Dates should be in the format mm/dd/yyyy.")%>


[View full width]

<%=(String(Request.QueryString("badDate")) != "undefined")?"The date you entered was not in the proper format. Dates should be in the format mm/dd /yyyy.":""%>


[View full width]

<cfif isDefined("URL.badDate")>The date you entered was not in the proper format. Dates should be in the format mm/dd/yyyy.</cfif>


[View full width]

<?php if (isset($_GET['badDate'])) { echo "The date you entered was not in the proper format. Dates should be in the format mm/dd/yyyy."; } ?>


With the date validation message in place, we're ready to insert the no-results text.

3.

With the cursor next to the code just entered, insert the following code:

From the Snippets panel, open the Recipes > ConferenceRoom > Custom Code folder for your server model and insert the No Results Error - Dynamic Text snippet.

[View full width]

<%=(String(Request.QueryString("noResults")) != "undefined")?"There are no meetings scheduled that match your search.":""%>


[View full width]

<%=(String(Request.QueryString("noResults")) != "undefined")?"There are no meetings scheduled that match your search.":""%>


[View full width]

<cfif isDefined("URL.noResults")>There are no meetings scheduled that match your search.</cfif>


[View full width]

<?php if (isset($_GET['noResults'])) { echo "There are no meetings scheduled that match your search."; } ?>


At this point in the process, you can test your error messages in Live Data view by entering arguments in the Live Data toolbar. Try badDate=true to see the date validation message and noResults=true to see what will happen when no matches are found for the search [r3-15].

r3-15.





Macromedia Dreamweaver 8 Recipes
Macromedia Dreamweaver 8 Recipes
ISBN: 0321393910
EAN: 2147483647
Year: 2003
Pages: 121

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net