Tom Muck

Alpha Dog Blues Band
Home page
All articles | DWTeam | Flash Remoting | Basic-Ultradev | Community MX
All Extensions | Extension News | Extension FAQs | Customer Login
Books authored or co-authored by Tom Muck
Extensions, books, and other products | Customer Login
Your current cart contents Blog | CMXTraneous Blog | Flash Remoting Blog
About the site


Sort Repeat Region: Frequently Asked Questions

Q: Does the extension work with Dreamweaver MX and DW MX 2004?

A: Yes.

Q: Does the extension work with hand-coded pages?

A: No. The extension works in conjunction with pages that use the UltraDev or Dreamweaver MX recordset and repeat regions.

Q: What should I put in the Keep These Parameters box?

A: The box allows you to keep search criteria from previous pages, without clogging up the URL with unnecessary variables. For example, if you have a search results page that spans mulitple pages, Dreamweaver will put parameters like "offset" and "page" into the URL string. These types of parameters don't have to be retained when a user clicks a column heading to sort. A search field from a previous page DOES have to be retained, however. For that reason, you simply type in the names of the form fields that need to be retained. For example, if you have a simple search field named "textfield", you would enter the following:


If you have a search field named "textfield", a checkbox named "checkbox" and a dropdown list named "begindate", you would enter this:


Q: Which versions of UltraDev does the extension work with?

A: The extension works only with UltraDev 4. UltraDev 1 had a completely different architecture and is not supported. It also works with Dreamweaver MX. When you purchase, you will be able to download the UD4 version and the DW version.

Q: I tried to apply the extension to a table that displays the results of a stored procedure, but it isn't sorting. Does it work with stored procedures?

A: It won't work with a standard stored procedure that returns a resultset because the SQL is generated dynamically by the Sort Repeat extension. However, through careful hand coding you can adapt your stored procedure to accept dynamic columns for sorting. The extension is not supported for this type of page, though.

Q: I'm using the Sort Repeat extension on a search page, but when I click the table heading, I lose the search parameters.

A: There could be one of two problems: either you didn't fill in the box for "Use These Parameters", or you are using a Form-specifc variable reference in your recordset. When you create recordsets in UltraDev or Dreamweaver MX using the Simple recordset dialog box, the dialog box allows you to filter by form variable or by querystring variable. However, the way that many of the UltraDev or Dreamweaver MX server behaviors work is to allow you to use a Post method in your form, thereby filtering the recordset by the form variable, but on the second pass when you click a link to take you to the next set of results you are using a querystring variable instead of a form variable. You can do this by using a generic request variable instead of specifying a form variable. In other words, don't use this:

Request.Form("myFormVariable") ASP
#Form.myFormVariable# ColdFusion

instead, use this:

Request("myFormVariable") ASP
#myFormVariable# ColdFusion

Q: Does this server behavior work with the Recordset Navigation Suite or the Dynamic Search SQL server behavior?

A: Yes, it is fully compatible with those extensions.

Q: Which PHP server model does the extension work with?

A: It works with the MySQL server model in Dreamweaver 6 and higher.

Q: I keep getting the following error message

While executing onLoad, the following JS error occurred:
At line 396 of file 'sort repeat region.cfm': trObj.tagname has no properties

A: That is usually caused by not having the appropriate number of columns listed in the Sort Repeat dialog box. The extension requires that the columns listed in the dialog box MUST match the number of columns in your table. In other words, if your.cfmL table has 4 columns, you need to specify 4 columns in the dialog box. If your column doesn't contain dynamic data or if you don't want to use a link on that particular column, simply choose the option **no link** from the dropdown box.

Q: I've used the extension in the past using PHP with the ADODB server model from Interakt, but now it doesn't work any more. Is there a fix?

A: The PHP extensions (PHAkt and ImpAKT) have gone through several versions, and imcompatibility problems between the server model and the Sort Repeat extension have been introduced at various stages. At this point the extension only supports the standard Dreamweaver PHP/MySQL server model.

Q: I've used your extension in the past without fail. However, I'm on this one particular page it's not working. I'm getting the following error when I try to sort on the "CustNo" field. All other fields are fine.

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Ambiguous column name 'CustNo'.
/index.asp, line 34

A: That is a limitation of the SQL because there are two references to one column in the SQL statement, but there is an easy way to fix it. Simply give your ambiguous column an alias, like this:

SELECT Customers.CustNo as MyCustNo, Customers.CustName, Orders.OrderInfo
FROM Customers INNER JOIN Orders
ON Customers.CustNo = Orders.OrderNo

Now, the order by clause will work with the MyCustNo alias rather than the ambiguous CustNo.

Q: How can I add a secondary sort to the column headings?

A: Actually it's quite easy with a little hand-coding of the links in the column headings. Simply put the secondary sort fields in a comma separated list, like this:


<a href="<?Php echo ($tfm_orderbyURL); ?>First,Last,Email">First</a>


<a href="<%=tfm_orderbyURL%>First,Last,Email">First</a>


<a href="<cfoutput>#tfm_orderbyURL#</cfoutput>First,Last,Email">First</a>

Now, the order by clause will sort on all fields.

Q: Can I add up and down sort links to the column headings?

A: You can't do this through the interface, but the code to do this is reproduced below. Basically it involves setting up two more links: one for ascending searches, one for descending searches. Then you can hand-code the links around your text or images in the table heading. This might break the automated functionality of the Sort Repeat Region extension, however.

Put the following code below the sort repeat code in the page (right before the <html> tag):


$tfm_sortAsc = $_SERVER["PHP_SELF"] . "?" . $tfm_keepParams . "tfm_order=ASC" . "&tfm_orderby=";
$tfm_sortDesc = $_SERVER["PHP_SELF"] . "?" . $tfm_keepParams . "tfm_order=DESC" . "&tfm_orderby=";


tfm_sortAsc = Request.ServerVariables("URL") & "?" & tfm_keepParams & "tfm_order=ASC&tfm_orderby="
tfm_sortDesc = Request.ServerVariables("URL") & "?" & tfm_keepParams & "tfm_order=DESC&tfm_orderby="


<cfset tfm_sortAsc = CGI.SCRIPT_NAME & "?" & tfm_keepParams & "tfm_order=ASC&tfm_orderby=">
<cfset tfm_sortDesc = CGI.SCRIPT_NAME & "?" & tfm_keepParams & "tfm_order=DESC&tfm_orderby=">

Now, you have to add your ascending and descending links in the column headings to take the place of the toggling asc/desc link that is there now (this orders on a field named "First" using simple text links UP and DOWN):


<a href="<?php echo ($tfm_sortAsc); ?>First">UP</a> |

<a href="<?php echo ($tfm_sortDesc); ?>First">DOWN</a>


<a href="<%=tfm_sortDesc%>First">UP</a> | <a href="<%=tfm_sortAsc%>First">DOWN</a>


<a href="<cfoutput>#tfm_sortAsc#</cfoutput>First">UP</a> |

<a href="<cfoutput>#tfm_sortDesc#</cfoutput>ISBN">DOWN</a>


Now the page should work with ascending and descending sorts.

Pay me securely with your Visa, MasterCard, Discover, or American Express card through PayPal!
Pay me securely with your Visa, MasterCard, Discover, or American Express card through PayPal!
About | Privacy Policy | Contact | License Agreement | ©2002-2018 Tom Muck | Dreamweaver Extensions