Show If Field Has Changed

The purpose of the Show If Field Has Changed server behavior A server behavior is a reusable component for server-side development. They add blocks of code to your pages for accomplishing specific tasks. Dreamweaver comes with several default server behaviors and the InterAKT extensions add many more to this list. is to allow the display of a region only when a certain table field changes its value. Before applying it, create a recordset A recordset is the result of executing an SQL query A query is a SQL command that will extract information from the tables of a database. Essentially, a query is a request for information from your database.. It is composed of multiple rows, each row having multiple columns. The columns presented in the query result depend on the column list declared in the query (they can belong to different tables). The number of rows and their order depend on the query conditions (WHERE, GROUP BY, HAVING, ORDER). The recordset acts as a source of dynamic data The InterAKT Dynamic Data tool is a replacement for the standard dynamic data dialog. It is used in the MX Kollection 3, to provide a unified way of building mark-ups, or place holders. These are recordset fields, server or session variables, and other types of dynamic data that are replaced at runtime by their corresponding values in web applications. containing the field to be used in the condition, and then select or create the page content that will be displayed when the field changes. If no content is selected, an error message will be displayed when trying to apply the server behavior.

You can access this server behavior from the Application panel, Server Behaviors -> + -> MX Kollection -> Conditional Regions -> Show If Field Has Changed.

The user interface has two tabs. Directions about their correct configuration are given below.

 

To set the dialog box options for the first tab, follow the next steps:

  1. In the Recordset drop-down menu select the beforehand created recordset that contains the field to act as a condition. By default, the first recordset on page is selected.
  2. In the Field drop-down menu select one of the recordset's field that will be the condition. If that field's value will change, then the region will be displayed; if its value does not change, the else region (if any) will be displayed. The first field returned by the recordset will be selected by default.
  3. The Has ELSE checkbox creates a new region that is displayed when the field changes. It is similar to the one used in the Show If Conditional Region. If the Has ELSE option has been checked, you will have to replace the Else text: replace this with the content that should appear when the specified condition is not met.

  4. The three buttons in the top right corner of the interface offer you the next functionalities:
    ·  Click OK when you are done configuring the server behavior.
    ·  Click Cancel to exit without applying the new settings.
    ·  The Help button opens this help page.
    These buttons are common to both tabs of the Show If Field Has Changed server behavior interface.

  5. Click on the Advanced tab to continue with configuring the server behavior.

 

 

To set the dialog box options for the second tab, follow the next steps:

  1. In the Name text box enter a name for the conditional region. This name must be unique on page. Change the default name only if you are certain that no other element has the same name. If you do not have any special requirements regarding the region's name, you can skip configuring this tab.
  2. The Has ELSE checkbox has the same functionality as the one in the Basic tab (described above), allowing the display of a region if the field does changes.
  3. Click OK when you are done configuring the server behavior.
 

After applying this server behavior, at least one translator is shown on page: the one surrounding the initial region. If the Has ELSE option has been checked, then a second translator containing a bogus content ("Else text: replace this") will be displayed. Replace this content with the one you want to display.

In order to change the field that acts as the condition, or to add/remove an ELSE region, simply edit the existing Show If Field Has Changed server behavior from the Server Behaviors tab. When removing an ELSE region, its content will be added after the IF region's content.

Related Topics