Create the NeXTensio list

In this topic you will create and enhance a NeXTensio list that will display all users in the database. After the list has been successfully created, you will enhance it, by changing the way the access level is displayed: it will use labels instead of numeric values.

To create the NeXTensio list, follow the next steps:

  1. Open the site index in Dreamweaver. If you have not created it yet, do it now. Also check that you have a working database connection that points to the database table mentioned in the previous topic.

  2. Click on the Create NeXTensio List Wizard icon on the MX Kollection tab of the Insert panel to start the list wizard.

  3. Configure the first step of the wizard as explained below:

  4. In the second step of the wizard you will have to define which fields will be displayed in the form, and their attributes:

  5. In the third step, you can configure the filter form elements that will be displayed for each table column. Configure the user interface as follows:

  6. In the wizard last step, select options that concern the list look and feel:

At this point you can click on the Finish button, save the page, upload it to the server (together with the includes folder) and preview it in the browser. It will display the user list. The access level is displayed as a number however (see below).


 

Next, you're going to correct this, and make the list much more clear, by replacing the number with administrator or user, depending on the value. To enhance the list, follow the next steps:

  1. In the NeXTensio list, select the dynamic text that contains the user level (in the fourth column):


     

  2. Now delete the selected text. Press the delete key. In the empty place, type the label for users with the access level 0 - in this case, it's simply User. Select the entered text:


     

  3. Apply the Show If Conditional Region on the selected text. You can access this server behavior from the Servers Behavior tab > + > MX Kollection > Conditional Regions.

  4. In the dialog box that opens, you have to define the condition to evaluate. For the first member of the expression, use the dynamic data icon to select the field storing the access level of the list recordset:


     

  5. The operator is the equality condition (==). Select it from the drop-down menu between the two expressions.

  6. In the second expression's text field, enter the value the level should equal to display the entered text. In this case, it should be 0.

  7. To allow displaying an alternate value if the condition is not met, also check the Has ELSE option.


     

  8. In Dreamweaver, a translator is now shown around the text entered at step 2. Some new text is displayed next to the else translator: Else text: Replace this.


     

  9. Now it is time to add the Administrator label. At the beginning of this tutorial, there has been established that only two user levels will exist: 0 and 1. Therefore, if the dynamic field does not equal 0, it must be one. Based on this simple principle, the Administrator label should be displayed when the User one does not.

  10. Replace the else text added by the conditional region with the Administrator label.


     

  11. This is the only change you need to make in order for the list to display elements other than the default. If you save the page and preview it in the browser, you will see labels instead of numbers:


     

In this tutorial you have learned how to customize the NeXTensio list in order to display information the way you need it.