FredTek

Dynamic Header Content

Problem:

When developing an application, the same form is used for inserting and modifying content. The client has decided that the title of the page MUST indicate the operation that is being performed.

Solution:

NetDynamics always generates dynamic content for HTML by starting at the opening [[SPIDERPAGE NAME=xxx]] tag and ending at the closing [[/SPIDERPAGE]] tag. By default, the header content for the page is above the opening tag. To get dynamic content in the header, the opening tag must be moved up in the HTML template for the NetDynamics page so that a static text field for the portion that must be dynamic can be added.

Simply follow this procedure:

  1. Set up the page as normal
  2. Run the page
  3. View the source of the generated page. Select the <FORM NAME="yadayada"> from the source that you are viewing and copy it.
  4. Open the HTML template for the page and paste the selected text right below the SPIDERPAGE tag.
  5. Move the SPIDERPAGE tag to right above where you want the static text field to go and surround it with a comment tag. The SPIDERPAGE tag should appear in the HTML as:
    <!-- [[SPIDERPAGE NAME=pgInformation]] -->
  6. Now add a static text field and move the spider page tag to where it is needed.
  7. Add any logic that is required to dynamically modify the value of the static text field to the onBeforeDisplayEvent for the page, row, or static text field.