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

Hotlists

Hotlists are treated differently than all other data sites. They require that an anchor already exist and that a Data Site is placed immediately before it., In the Bind Editor, the SaPopulateHotList or SaPopulateMasDetHotList Population Callback must be used.

Another differentiating feature of the Hotlist is that it's both a Data Site and an Activator. When the HTML document that contains the Hotlist is created, the Hotlist is a Data Site and is "populated" with detail information that is unseen by the user and visible information which the user clicks on. The Hotlist Anchor must then be bound as an Activator to define what happens when the user clicks on the Hotlist.

The first column in the results section will be the detail information that gets populated into the Hotlist item. When the Hotlist is bound as an Activator, the Project URL is added before the detail information. This detail information is used when the Hotlist item is clicked and it calls the Project URL. The detail information is the Arguments for which the Hotlist becomes the Activator.

Steps for Creating a Simple Hotlist

Given data of this type:
CREATE TABLE thing
	(id int, /* Unique Key */
	name char(12)
	description varchar(256))
Given HTML Block:
##Sa_ThingHL##<A HREF="ThingHLActivator"></A>
  1. Press the Object Bind Editor (New Activator) button on the Project Window.
  2. Select an anchor to be used as the Activator that generates the Hotlist.
  3. Open the Data Object in the Bind Editor that is used for Populating the Hotlist.
    Use DSQL Data Object:
    	SELECT id, name FROM thing
    
    Bind Results Columns id and name to the Hotlist
  4. In the Bind Editor, select the Template in which the Hotlist resides.
  5. Select the ThingHL Data Site from the combo box list in the Results area of the Bind Editor for id and name.
  6. Press the Detail button for the id column. This invokes the Results Detail Dialog. By having (id) first, it automatically becomes the detail information for the Hotlist. The remaining columns (name) become the visible data that the user sees in the Hotlist item.
  7. In the Results Detail Dialog, choose SaPopulateHotlist from the combo box list of Callbacks.
  8. Press Apply.
  9. Press the Object Bind Editor (New Activator) button on the Project Window.
  10. Select the Hotlist Anchor ThingHLActivator and press Ok.
  11. Open the Data Object in the Bind Editor that is called when the Hotlist is processed:

    DSQL Object:
    SELECT name, description FROM thing WHERE id = #id, 	
    NO_WRAP#
    
  12. Select SaGetNArg(0) as the Argument value. This tells Sapphire/Web to use the first (0th) argument that comes across as the argument to the DSQL Object. In this case it is the Hotlist's detail information (id).
  13. Select a Template and bind (name) and (description) to any Data Sites in it.
  14. Apply and Test.
When the Hotlist is clicked, the CGI will generate HTML displaying the Name and Description of the Thing in the database table.

Multiple Detail Information Columns in a Hotlist

A Hotlist can have more than one column of detail information. To do this:

  1. Write your Data Object so that all the Detail Columns are first and visible columns are after the detail information.
  2. In the Object Binding that populates the Hotlist, choose the Hotlist as the Data Site for each detail information and visible column.
  3. Bring up the Results Detail Dialog for the first detail information column.
  4. Choose SaPopulateHotlist as the Callback.
  5. Type the number of detail information columns in the Client Data field as:
    (void*)number.
    
  6. Press Apply.
  7. When creating the Data Object to use as the Activator Object Binding portion of the Hotlist; it should have arguments for each detail information column.
  8. Bind each Argument as SaGetNArg(0), SaGetNArg(1), ... SaGetNArg(n). The detail information should correspond to your Data Object Arguments.
  9. Bind your results to whatever Template you need.


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