Calling element values

After designing a static version of your HTML page, using placeholders for element values, you can overwrite each placeholder text with script that will call the values of each element dynamically from your uploaded page.

Procedure

  1. If you want to design the layout of your page first, design your web page, leaving static text as a placeholder for a dynamic value.
  2. Edit your HTML file, including the manage.inc file in the header of the HTML file in script tags before the </head> tag:
       <head>
          <title>Your Title Here</title>
          <script src='manage.inc'></script>
       </head>

    The manage.inc file includes a collection of JavaScript files that control client-side behavior of the IBM® Rational® Rhapsody® web interface.

  3. Edit your HTML file, substituting function-calling script for each static value placeholder.

    For example:

       <body>value of evStart</body>

    This becomes:

       <body><script>show(‘nameOfElement')</script></body>

    In this sample code, nameOfElement is the element name assigned to the element by Rational Rhapsody, visible in the default web interface. Be sure to use the full path name of the element in the show function, as in the following example:

        show('ProcessController[0]::OMBoolean_attribute');
  4. Save the file and upload it to the Rational Rhapsody web server (see Adding web files to a Rational Rhapsody model).

Results

You can link to this file in your web interface from your new design scheme. If you want to make a page the front page of your web GUI, see Setting a home page. Keep in mind that Rational Rhapsody does not yet support a hierarchical file structure, so HTML and image files are at the root directory of the web server.


Feedback