Adobe
GoLive 6 Dynamic Content Samples
Overview
Database Design
Contact Sheet
Medium Image
Large Image
Edit Album
Confirm Deletion

text

A. Dynamic table displaying photos. B. Text fields for editing photo information. C. Link to delete a photo. D. Form button to submit changes. E. Hidden code to clear the form for adding a photo. F. Text fields for entering new photo information. G. Form button to add a photo.

Content Sources

Unlike the Main View pages, Edit Album uses the GL_Album_PhotoData table directly.

A.

The dynamic table is bound to the PhotoData content source and displays all the photos. Notice that the update button is not part of this table. It is in a separate, static table. The two tables are contained within a single form so that the update button affects all of the photo information.

B.

These form controls use simple bindings to edit a photo's caption, date, base file name, and display status.

C.

The delete link uses Show Details of Current Record to display a delete confirmation page.

D.

The Form Action for the update button is Update Record. When you select a Form Action in the Dynamic Bindings palette, GoLive automatically targets the correct page in the config/actions folder to perform the indicated action. In this case, clicking the update button writes all of the changed photo information back to the database.

E.

There is hidden code here to make sure that the form fields in the add photo section are blank. Without this code, the form would display the first photo in the PhotoData content source. Here is what the code looks like in JSP:

<% gl.moveToEnd(PhotoData); %>

This code works by moving to the end of the record set. GoLive uses this idiom consistently to display new, empty records.

It is a good idea to include hidden code like this in any form that should be blank. Notice that the hidden code is the first element in the form, so that it will move with the form if the page design changes. To reuse this code simply replace 'PhotoData' with the name of the content source on your page.

F.

These form controls use simple bindings to set the caption, date, base file name, and display status of a new photo.

G.

The Form Action for the add button is Add Record. Clicking this button adds a new photo to the database.