1 Reply Latest reply on May 18, 2015 1:16 PM by dng

    Pbd1 + VBScript # Do not work method

    Nikolay

      Can't override the Click method. How to do it?

       

       

      <%@ Page Title="Home Page" Language="C#" AutoEventWireup="true"

          CodeBehind="Default.aspx.cs" Inherits="testactiveviewaspnet._Default" %>

      <html>

      <head id="Head1" runat="server">

          <title></title>

          <script language="vbscript" type="text/vbscript">

              Sub Pbd1_ReadyStateChange(nReadyState)

                Dim dsp

                set dsp=Document.GetElementById("Pbd1")

      //!!!!!!!!!!!!!!!!!!!!

                AddHandler dsp.Click, New EDisplay_ClickEventHandler(AddressOf MyDisplay_Click)

      //!!!!!!!!!!!!!!!!!!!!

              End Sub

       

      //!!!!!!!!!!!!!!!!!!!

             Sub MyDisplay_Click(ByVal lvarX as Integer, ByVal lvarY as Integer)

                Alert "Hello"

             End Sub

      //!!!!!!!!!!!!!!!!!!!!

          </script>

      </head>

      <body>

          <h2>

              PI ActiveView with VBScript

          </h2>

          <p>

              <object ID="Pbd1"

              WIDTH="90%"

              HEIGHT="90%"

              CLASSID="CLSID:4F26B906-2854-11D1-9597-00A0C931BFC8">

         <param name = "DisplayUrl" value="http://localhost:26657/Trend.pdi"/>

              </object><br />      

          </p>

      </body>

      </html>

        • Re: Pbd1 + VBScript # Do not work method
          dng

          Hi Nikolay,

           

          Client-side scripting cannot respond to ActiveView automation events (e.g. Display open events, Display clicks events, etc.). However, client-side scripting can execute public methods and fire events on an ActiveX control.


          To get around the issue, you can look into adding client-side scripting on other DOM elements on the HTML page. If you do want to respond to a mouse click on the display, one alternative would be to overlay a transparent element on top of the display that responds to the mouse click events. Can you give us more information on what you are trying to achieve?