[Top] [Prev] [Next] [Bottom] [Contents]

Binding Hotlist URLs and Multiple Result Data Sites

In this section you will create bindings that use Hotlist items as activators. The first binding populates book_detail.html with the name and sales data of the book title the user clicks. The second binding populates book_detail.html with information about the author of the book selected. The third populates book_detail.html with publisher information. The result will be that the same hotlist activator will call three different DSQL objects which will populate four data drop sites in book_detail.html.

The First Binding

1. Bring up the Object Bind Editor for a new activator.
2. Select book_results.html as the document.
3. Select the TitleDetail anchor as the activator.
4. Click Ok.
5. The Open DSQL window appears. Select pubs2 at the database.
6. Select the DSQL object BD_Title_And_Sales_By_Id. Click Ok.
7. This DSQL object requires one argument, called title_id, to perform its function. At title_id WRAP: click on the down arrow to select: SaGetNArg(0). When the user clicks on a hotlist item, SaGetNArg(0) will extract the first argument from that hotlist item and pass this argument to the chosen DSQL object.
8. At Results<=>Template select book_detail.html as the template for this binding.
9. Select Title as the data site for the result column varchar.
10. Select TotalSales as the data site for the result column total_sales. The Object Bind Editor should look like Figure 4-11.
The Title and TotalSales data drop sites do not require special handling like the Options Menu and Hotlist; there is no need to go to the Results Detail Editor.
11. Click Ok to create this binding and close the Object Bind Editor.

Figure 4-11 Binding Title and Sales to book_details.html

The Second Binding

1. To create the second object binding, bring up the Object Bind Editor for a new activator.
2. Select book_results.html as the document.
3. Select TitleDetail as the activator. Click Ok.
4. Select the DSQL object BD_Authors_By_Title_Id from the database pubs2. Click Ok.
5. This DSQL object also requires one argument, named title_id, to perform its function. Under Arguments<=>Activator, select SaGetNArg(0) as the value for the argument title_id.
6. Select book_detail.html as the template to be populated by the data object.
7. BD_Authors_By_Title_Id will return three values: an author id, the author's first name, and author's last name. All of these values will be placed in the same data drop site.
8. At au_id select AuthorHotList as the data drop site.
9. At au_fname select AuthorHotList as the data drop site.
10. At au_lname select AuthorHotList as the data drop site.
11. Since the author values are being placed in a hotlist, bring up the Results Detail Editor for one of the result columns and select SaPopulateHotList. Click Ok. The Object Bind Editor should look like Figure 4-12.
12. Click Apply to create this binding, then File->Close .

Figure 4-12 Binding Authors to book_detail.html

The Third Binding

1. Select the Object Bind Editor for a new activator.
2. Select book_results.html as the document. Select Title Detail as the activator. Click Ok.
3. From the Open DSQL window, select BD_Publishers_By_Title_Id from the database pubs2. Click Ok.
4. From the Object Bind Editor, select SaGetArg(0) as the value for the argument title_id. This will extract the first argument from the Hotlist item clicked and send that argument along to the data object.
5. Select book_detail.html as the template.
6. Select PublisherHotList as the data drop site for both of the result columns.
7. Bring up the Results Detail Editor for one of the results columns and select SaPopulateHotList as the population callback. This will affect both of the results columns.
8. The Object Bind Editor should resemble FIgure 4-13. Click Ok.

Figure 4-13 Binding Publishers to book_details.html

9. From the Project Window, Save and Test the project.

Testing the Hotlist Bindings

1. Clicking the Book Search button and perform a Book Query with % and whichever Category you choose. The Hotlist items in the Book Results page are now alive because of your latest object bindings.
2. Select a book from the list. This will bring up the book_details.html page with details about that particular title (Fig. 4-14).

Figure 4-14 Book Detail Page

Note that the Author and Publisher results have been bound to Hotlists, but for now they point to nothing. In the next tutorial you will complete these bindings.



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.