In this section of the tutorial you will build the pages that will display the order list and details. Before continuing with the page creation, it is recommended that you read and understand the way a master-detail relation can be implemented using NeXTensio in the How to build master-detail lists and forms tutorial.
The first page to create is the master NeXTensio list, displaying the basic order details from the order_ord table. To complete it, follow the next steps:
Open the admin/index page in Dreamweaver.
Start the Create NeXTensio List Wizard from the MX Kollection tab of the Insert bar. The wizard is divided into several steps which you have to configure in order to create the list.
In the first step of the wizard, you have to configure the data source information:

In the second step of the wizard you have to define what columns will be displayed from the selected table and what values to show. If you need to display the actual label for a foreign key column (e.g. the idusr_ord column), simply use the look-up table option, to automatically create the JOIN operation and display the correct label.
Remove the sesid_ord field from the grid by selecting it and clicking on the Minus (-) button.
Set the idusr_ord field to use a look-up table. In the Database table drop-down menu select the user_usr table, for the Label column the name_usr column, and for the Value column the id_usr column. By doing this, the user name is displayed instead of the ID.
Do the same for the idsta_ord column, but use the status_sta table and the name_sta column for the label.
Also change the labels for the idusr_ord
and idsta_ord fields, by replacing the existing
ones with User and Status.

The third step of the wizard allows defining the filter elements to use for each of the list columns. For columns using look-up tables, the element is automatically set to menu and the dynamic content is based on the same table as the one selected in the wizard's second step. You do not need to modify anything in this step, so simply skip it.
The last wizard step offers the possibility to set list settings: the ordering column, skin, navigation and button options.






// Load the KT_back class
require_once('../includes/nxt/KT_back.php');
For ColdFusion:
<cfinclude template="../includes/nxt/KT_back.cfm">
For ASPVBScript:
<!--#include file="../includes/nxt/KT_back.asp"
-->
Now you have to filter the list. By default, it will display all details for all orders and not only for the one selected in the master list. To filter the list, you must filter its recordset:
Double-click the ListRecordset from the Bindings panel. This will open the Recordset dialog box, in Advanced view.
The SQL code until
now should look similar to the following:
SELECT product_prd.name_prd AS idprd_opr, order_product_opr.quantity_opr,
order_product_opr.id_opr
FROM order_product_opr LEFT JOIN product_prd ON order_product_opr.idprd_opr
= product_prd.id_prd
WHERE NXTFilter
ORDER BY NXTSort
To display only the relevant records, the recordset
must be filtered by the id_ord URL parameter
passed by the details link. To
add the filter, first define a new variable. Click the Plus
(+) button on top of the Variables
grid, and configure it as shown in the image below:
Note: For ColdFusion, you can
ignore this step for now. The same procedure is easier to be done as part
of step 4.
Now you will have to edit the SQL
query. It already contains a condition - WHERE NXTFilter
- that allows the NeXTensio filter to function.
To add a new condition that will be evaluated on the same level as the
first one, use the AND operator. The condition to add is: AND
idord_opr = orderid. Add this after the existing condition and
the recordset will be filtered.
The new SQL query will look like:
SELECT product_prd.name_prd AS idprd_opr, order_product_opr.quantity_opr,
order_product_opr.id_opr
FROM order_product_opr LEFT JOIN product_prd ON order_product_opr.idprd_opr
= product_prd.id_prd
WHERE NXTFilter AND idord_opr = orderid
ORDER BY NXTSort
For ColdFusion, add AND
idord_opr = #URL.id_ord# after the WHERE #PreserveSingleQuotes(SESSION.filter_tfi_listorder_product_opr1)#
line.
The final SQL code will look like this:
SELECT product_prd.name_prd AS idprd_opr, order_product_opr.quantity_opr,
order_product_opr.id_oprFROM order_product_opr LEFT JOIN product_prd ON
order_product_opr.idprd_opr =
product_prd.id_prd WHERE #PreserveSingleQuotes(SESSION.filter_tfi_listorder_product_opr1)#
AND idord_opr = #URL.id_ord#ORDER BY #SESSION.sorter_tso_listorder_product_opr1#
Click OK to close the recordset dialog box. Save the page and upload it to the server.
Now when you preview the main list in the browser and click on one of
the order's details
button, the detail list will only display the products that the order
is composed of:

To further improve the list, you can enter a better title (replace the order_product with Order details) or modify the list recordset to display the product price as well.
For the overall application improvements, you can create product and user management pages, using NeXTensio lists and forms.