I'm sure that is a very common expression.

First off I want to thank everybody, especially the people working on
DynAPI.  I've been messing with this for a few weeks now, and just joined
the list today.  I moved into web development (ASP) from MQ/Series
management (who'd've thunk it).

I am trying to set up a couple tables that sit on top of each other.  I want
a row of buttons above these tables that will turn the corresponding table
visible and the rest invisible.  This creates a tabbed affect.  I'm sure
there are other ways of doing this (and if anyone has a simplier one, let me
know).

I have this working in IE 4 (I think), IE 5, and Netscape 6.  I am having
problems loading the page with Navigator 4.08 and Communicator 4.77.  Mind
you, I'm running these browsers from Win2K, and servering the pages from IIS
on the same Win2K box.

The ASP code is below, and I feel I should try to explain some of it here.
We are using ASP, and though the ASP in this example doesn't actually do
anything, it is there out of habit.  In the production system we are
querying a DB and crunching some numbers.  These numbers are what go into
the tables I'm trying to display.

I'm using the Sun/Netscape ClientSniffer JavaScript so I can gracefully show
a different version for older browsers and Opera.  The "older" version will
simply be a row of links that will scroll down to the appropirate table.  It
is not as flashy, but works.  I've noticed that I can't use the OO version
of ClientSniffer with DynAPI.  I imagine the is object is already being
used.  I occasionally run into problems with IE that I think are related to
this is class.  There is a known bug with IE on Macs that sounds similar to
the problem I occasionally run into with IE on Win2K.  If anyone cares, I
can explain that, too.

I don't know if this is not working because of a browser problem, or if it
is not working because I did it wrong.  But on Nav 4.08 and Comm 4.77, it
just hangs durning the load.

Here is the code...
-----
<%
  dim NumberOfTables
      NumberOfTables = 2
  dim WidthofTabStrip
      widthofTabStrip = 300
  dim TabColor
      TabColor = "FF0000"
  dim TabColor_Selected
      TabColor_Selected = "00FF00"
%>

<html>

  <head>

    <script language='JavaScript'
src='../JavaScripts/ClientSniffer.js'></script>

    <script language='JavaScript'
src='../JavaScripts/dynapi/src/dynapi.js'></script>

    <script lanugage='JavaScript'>
      DynAPI.setLibraryPath('../JavaScripts/dynapi/src/lib/');
      DynAPI.include('dynapi.api.*');
      DynAPI.include('dynapi.event.*');
      DynAPI.include('dynapi.ext.inline.js');
      DynAPI.include('dynapi.util.debug');
    </script>

    <script language='JavaScript'>

      if (is_ie4up || is_nav4up) {
        DynAPI.onLoad = function() {

          var Tables = this.document.getAll()['Tables'];
          Tables.setVisible(true);

          // The following block of code must be repeated for each
          // Table in the document.  Until this can be set up in an
          // Array, we will have to repeat this block changing the
          // index manually.

          <% Dim Tab0Name
                 Tab0Name = "Foo" %>
          var Tab0 = this.document.getAll()['Tab0'];
          var Table0 = this.document.getAll()['Table0'];
          Tab0.setVisible(true);
          Tab0.setBgColor("<%=TabColor_Selected%>");
          Table0.setVisible(true);
          var event0 = new EventListener(this.document);
          event0.onmouseup = function() {
            Table0.setVisible(true);
            Tab0.setBgColor("<%=TabColor_Selected%>");
            Table1.setVisible(false);
            Tab1.setBgColor("<%=TabColor%>");
          };
          Tab0.addEventListener(event0);

          <% Dim Tab1Name
                 Tab1Name = "Kludge" %>
          var Tab1 = this.document.getAll()['Tab1'];
          var Table1 = this.document.getAll()['Table1'];
          Tab1.setVisible(true);
          Tab1.setBgColor("<%=TabColor%>");
          Table1.setVisible(false);
          var event1 = new EventListener(this.document);
          event1.onmouseup = function() {
            Table1.setVisible(true);
            Tab1.setBgColor("<%=TabColor_Selected%>");
            Table0.setVisible(false);
            Tab0.setBgColor("<%=TabColor%>");
          };
          Tab1.addEventListener(event1);
    
        };
      }

    </script>

  </head>

  <body>

    <p>
      <script language='JavaScript'>
          if (is_nav) {
            document.writeln("Navigator " + is_minor);
          }
          if (is_ie) {
            document.writeln("Internet Explorer " + is_minor);
          }
          if (is_opera) {
            document.writeln("Opera " + is_minor);
          }
      </script>
    </p>

    <script language='JavaScript'>

      if (is_ie4up || is_nav4up) {

        document.writeln("<table align='center'
width='<%=WidthofTabStrip%>'>");
        document.writeln("  <tr>");

        // Repeat the following lines for each table's tab.
        document.writeln("    <td>");
        document.writeln("      <div id='Tab0' style='position:relative;
visibility:hidden;'><p align='center'><%=Tab0Name%></p></div>");
        document.writeln("    </td>");

        document.writeln("    <td>");
        document.writeln("      <div id='Tab1' style='position:relative;
visibility:hidden;'><p align='center'><%=Tab1Name%></p></div>");
        document.writeln("    </td>");

        document.writeln("  </tr>");
        document.writeln("</table>");

      }
      else {

        documentwriteln("You are running:");
        if (is_nav) {
          document.writeln("Navigator " + is_minor);
        }
        if (is_ie) {
          document.writeln("Internet Explorer " + is_minor);
        }
        if (is_opera) {
          document.writeln("Opera " + is_minor);
        }

      }

    </script>

    <table align='center' border='0' width='<%=WidthofTabStrip%>'>
      <tr>
        <td>
          <div id='Tables' style='position:relative; visibility:hidden;'>
            <!--  Repeat the following lines for each table -->
            <div id='Table0' style='position:absolute; visibility:hidden;'>
              <!--#include virtual='/Test/oof.inc'-->
            </div>
            <div id='Table1' style='position:absolute; visibility:hidden;'>
              <!--#include virtual='/Test/egdulk.inc'-->
            </div>
          </div>
        </td>
      </tr>
    </table>

  </body>

</html>
------


Travis Garris, Ciber
Winston-Salem, NC

_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to