Siebel Tools Reference > Special Behavior Supported by Templates > Template Configuration Features >

Adding Sorting Capabilities to Your Application


To add sorting capabilities to your applications, you use the template file for the Sort Dialog by specifying the Application property Sort Web Page. You can use the Sort Dialog to show one or more instances of a list of fields to sort on, and the sorting order to use. You can invoke the Sort Dialog using a Control that invokes the SortOrder method. This control should be used only in base templates of List Applets.

You use the tag <swe:sort-field> to show the list of sortable fields and the sorting order options. This tag takes one attribute called sequence, which specifies the sort column order. This is a required attribute.

<swe:sort-field sequence="1"/>

This tag will render two HTML select lists. The first select list will show the list of fields that can be sorted and have been mapped to <swe:control> tags in the base template for the applet. The second select list will show the two options for sorting order: Ascending and Descending. You can have as many <swe:sort-field> tags in the Sort Web Page as you want. Each <swe:sort-field> tag should specify the order in which the selected columns should be sorted, using the sequence attribute.

To create the link or button that would execute the sort, create a Web Page Item that invokes the ExecuteSort method. You do not have to specify the parameters View and Applet for this method; these will default to the currently active view and applet.

Example

Below is a fragment from a sample Sort Web Page.

<swe:form>

<table width=100% bgcolor="#EEEEEE" border=0 cellspacing=0 cellpadding=3>

<tr>

<td><swe:pageitem id="1" property="DisplayName"/></td>

<!--"Sort By" Label -->

</tr>

<tr>

<td><swe:sort-field sequence="1"/></td>

<!-- First column to sort on -->

</tr>

<tr>

<td><swe:pageitem id="2" property="DisplayName"/></td>

<!-- "Then By" Label -->

</tr>

<tr>

<td><swe:sort-field sequence="2" /></td>

<!-- Second column to sort on -->

</tr>

<tr>

<td><swe:pageitem id="2" property="DisplayName"/> </td>

<!-- "Then By" Label -->

</tr>

<tr>

<td><swe:sort-field sequence="3"/></td>

<!-- Third column to sort on --></tr>

<tr>

<td><swe:pageitem id="5" property="FormattedHtml"/></td>

<!-- Execute Sort -->

</tr>

</table>

</swe:form>


 Siebel Tools Reference
 Published: 20 October 2003