[Prev] [Next] [Top] [Bottom] [Contents] (4 out of 6)

Creating Bindings Between Hotlist URLs and Multiple Result Data Sites

The next portion of the tutorial creates three new bindings that all use Hotlist items as activators. The first binding causes the Hotlist to put the textual title, and the sales volume for a particular book into your last HTML document, book_detail.html. The second binding puts author information in a hotlist in book_detail.html, and the third puts publisher information in another data drop site in book_detail.html. The result will be that the same hotlist activators will call three different DSQL objects which will populate four data drop sites in book_detail.html.

Step 1. To create the first object binding, bring up the Object Bind Editor for a new activator. The Activator Selector pops-up.
Under Document: select book_results.html
Under Anchor: select TitleDetail anchor as your activator,
Press Ok.
The Open DSQL Window pops-up.
Step 2. Under Database: select pubs2
Under DSQL Name:, select BD_Title_And_Sales_By_Id
Press Ok.
Open DSQL goes away and Object Bind Editor becomes active.
Step 3. This DSQL object requires one argument, a title id, to perform its function.
At title_id WRAP: click on the down arrow (combo Box) to select: SaGetNArg(0).
In your end-user application, when the user clicks on a Hotlist item, SaGetNArg(0) extracts the first argument from that Hotlist item, passing the value as an argument to the chosen DSQL object.
The BD_Title_And_Sales_By_Id DSQL object returns two values, a title and a numeric value representing total sales.
Step 4. At Results<=>Template select book_detail.html,
At title varchar: select Title,
At total_sales: select TotalSales.
Press OK to create this binding and close the Object Bind Editor.
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.
When completed. the object bind editor should look like Figure 3-15.

Figure 3-15 Binding Title and Sales to book_details.html

Step 5. To create the second object binding, bring up the Object Bind Editor for a New Activator.
The Activator Selector window pops-up
Step 6. Under Document: select book_results.html as your document
Under Anchors: select TitleDetail as your activator,
Press Ok.
Open DSQL Window pops-up.
Step 7. At Database: select pubs 2
Under the DSQL Name: select BD_Authors_By_Title_Id
Press Ok.
The Object Bind Editor pops-up.
Step 8. This DSQL object also requires one argument, a title id, to perform its function.
Under Arguments<=>Activator: At title_id WRAP SaGetNArg(0) is the argument.
Under Results<=>Template: Select book_detail.html. The Bd_Authors_By_Title_Id returns three values; an authorid, the author's first name, and author's last name.
At au_id select AuthorHotList as the Data Drop Site.
At au_fname: select AuthorHotList as the Data Drop Site.
At au_lname select AuthorHotList as the Data Drop Site.
Step 9. Since the author values are being placed in a Hotlist, bring up the Results Detail editor and select SaPopulateHotList in the combo box. Click Ok. The Object Bind Editor should look like Figure 3-16.
Step 10. Press Apply to create this binding, then File->Close to close the Object Bind Editor.

Figure 3-16 Binding Authors to book_detail.html

Step 11. Create the third and final object binding. From the Project Window, select the Object Bind Editor for a New Activator.
Under Document: select book_results.html as your document.
Under Anchor: select Title Detail. Press OK. The Open DSQL Window pops up.
Under Database: select pubs2.
Under DSQL Name: select BD_Publishers_By_Title_Id. Press OK. The Object Bind Editor pops up.
Under Arguments<=>Activator: At Title_ID Wrap: select SaGetArg(0).
At Results<=>Template: select book_detail.html.
At pub_id: select PublisherHotList.
At pub_name: select PublisherHotList.
Step 12. Since the publisher values are also being placed in a Hotlist, bring up the Results Detail editor for pub_id. Click on the down arrow (combo box) for the Results Detail Editor, then select SaPopulateHotList in the combo box. Click OK.
The Object Bind Editor pops up and looks like Figure 3-17. Press OK.
Select File from the pulldown menu. Select Close (File->Close).

Figure 3-17 Binding Publishers to book_details.html

Step 13. Save your project using the File->Save menu, then press the Test button.
Bring up the Book Results as before by pressing on the Book Search button and performing a Book Query with "%" and "business". The Hotlist items in the Book Results page are now alive because of our latest object bindings.
Step 14. Select the anchor: Cooking with Computers: Surreptitious Balance Sheets.
This will bring up the book_details.html page with details about that particular title already filled in (see Figure 3-18).

Figure 3-18 Book Detail Web Page

Note that we bound the Author and Publisher results to Hotlists, but now they point to nothing. In Tutorial 2 we will specify bindings for them.


[Prev] [Next] [Top] [Bottom] [Contents] (4 out of 6)