Administrator Recipe: Add Conference Room

One of the elements essential to any meeting is a meeting room; likewise, an important part of a conference scheduling application is the capability to add and edit meeting room details. The Add Conference Room page is the first of two administrative pages concerned with managing meeting rooms. Although some rooms may be set up initially by the data source administrator, being able to bring new rooms into the application is an ongoing need.

The Add Conference Room page is a basic insert record page that utilizes a standard Dreamweaver server behavior, Insert Record.

Step 1: Implement Add Room Design

First, we'll build the framework for the page and add the necessary form elements.

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

    graphics/book.gif In the ConferenceRoomScheduler folder, locate the folder for your server model and open the new_conferenceroom page found there.

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

    graphics/book.gif From the Snippets panel, drag the Recipes > ConferenceRoom > Wireframes > New Conference Room - Wireframe snippet into the Content editable region.

  3. Within the table, place another another HTML table to hold the form's three elements: one text field, one text area, and a submit button.

    graphics/book.gif Place your cursor in the row below the words NEW CONFERENCE ROOM and insert the Recipes > ConferenceRoom > Forms > New Conference Room - Form snippet [r3-21].


    Figure r3-21.

    graphics/05fig21.jpg


Step 2: Insert Record New Conference Room

There's only one action to perform to complete this page add the Insert Record server behavior. After the record is inserted, the application presents the Meeting Request page where the new room is automatically incorporated.

For ASP
  1. From the Server Behaviors panel, choose Add (+) and then Insert Record.

  2. Select the desired data source connection.

    graphics/book.gif Choose Recipes from the Connection list.

  3. Choose the table in the data source that will receive the form values.

    graphics/book.gif From the Insert Into Table list, choose Rooms.

  4. In the After Inserting, Go To field, enter the page you want the user to visit after the record is inserted.

    graphics/book.gif Select Browse to locate the meeting_request page.

  5. Choose the form on the page from which to get the values.

    graphics/book.gif From the Get Values From list, choose NewConferenceRoom.

  6. In the Form Elements area, set the form elements to their corresponding data source fields.

    graphics/book.gif Set the RoomName form element to the RoomName data source field as text type.

    Set the RoomSpecs form element to the RoomDescription data source field as text type.

  7. Make sure your entries are correct and then click OK to close.

  8. Save the page.

For ColdFusion and PHP
  1. From the Server Behaviors panel, choose Add (+) and select Insert Record.

  2. In the Insert Record dialog, choose the current form.

    graphics/book.gif Select NewConferenceRoom from the Submit Values From list.

  3. Select your data source from the list.

    graphics/book.gif Choose Recipes from the Data Source list.

  4. Enter your user name and password, if needed.

  5. Select the table in the data source to insert into from the list.

    graphics/book.gif Choose Rooms (rooms for PHP) from the Insert Into Table list.

  6. Set the data source fields to their corresponding form elements.

    graphics/book.gif Make sure the RoomID data column is set to be an unused Primary Key;

    Set RoomName to the FORM.RoomName form element and submit as Text.

    Set RoomDescription to the FORM.RoomSpecs form element and submit as Text.

  7. In the After Inserting, Go to field, enter the path to the file you want the user to visit after the record is inserted.

    graphics/book.gif Select Browse and choose meeting_request.cfm or meeting_request.php as appropriate.

  8. Verify your choices and click OK to close the dialog.

  9. Save the page.

Note

One enhancement you might apply to this page is client-side validation to make sure that a particular field or fields are required. Dreamweaver's Validate Form behavior is perfect for this.




Macromedia Dreamweaver MX 2004 Web Application Recipes
Macromedia Dreamweaver MX 2004 Web Application Recipes
ISBN: 0735713200
EAN: 2147483647
Year: 2003
Pages: 131

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