Adobe
GoLive 6 Dynamic Content Samples
Overview
Database Design
Browse
Catalog Item
Find Items
Edit Item

text

A. Record number and count. B. Text fields for product name, price, and image. C. Dynamic pulldown menu of section names. D. Text area for product description. E. Form submission buttons. F. Link for creating a new product. G. Navigation links for moving between products.

Content Sources

The Edit Item page has two content sources: the Sections table, which is used to dynamically construct the pulldown menu of section names, and the Products query. The Products query uses record filtering to find the products that match a search request from the Find Items page. Here is what the query looks like in GoLive:

text

The 'like' keyword in the Match Patterns specifies a partial match, rather than the exact match that would occur from using '='. The '%' signs are wildcard symbols that match any number of characters. Because there is a '%' at both ends of each Match Pattern, the patterns match substrings. If there were only a '%' sign at the end of an expression, then that pattern would match prefixes; if there were only a '%' sign at the beginning, then it would match suffixes. The expressions within the curly braces are the ASP syntax for matching against URL parameters. A URL that targets this page should have the form edit.asp?Name=x&SectionName=y&.... If a parameter is missing, then the Match Pattern for that parameter is '%%', which matches anything.

The overall effect is to retrieve just the records that match the user's search request. The navigation links on the page allow the user to look at all of the matching records.

Tabs

The Main View tab uses Show Details of Current Record so that when a user clicks on it, he can see how the current product looks in the Main View.

A.

The record number and count indicate which product is being displayed and how many products match the user's search criteria. These special bindings are available at the bottom of the field list when you bind an element.

B.

The product name, price, and image are simple text and image bindings.

C.

The product section is bound to a dynamically constructed pulldown menu. The menu is identical to the one on the Find Items page, except that it uses the Sections table directly; there is no need for a blank entry.

D.

The text area for the product description is bound the same way as an ordinary text field. Since the description can include arbitrary punctuation and HTML markup, the binding uses the Encode String as HTML filter. This filter makes sure that special characters like '<' are handled correctly and do not cause unexpected syntax errors when the dynamic content is put into the page. It is a good idea to use this filter with all text area controls.

E.

The two form buttons have Form Actions selected from the Dynamic Bindings palette. GoLive automatically targets the correct page in the config/actions folder to perform the indicated actions, in this case either updating a product or deleting it.

F.

The link to create a new product uses Show Details of Empty Record. When the user clicks on this link, the form displays an empty record so that the user can enter a new product. Nothing is really added to the database until after the user clicks the update button, so it is easy to cancel the action.

G.

Clicking one of the navigation links redisplays the page with a different product. These links are created using the navigation Link Actions in the Dynamic Bindings palette. GoLive automatically sets the href for each link to be the current page, edit.asp.