This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Event data from WEB-BROWSER2

We are in the process of implementing the 10.5 thin-client runtime.  One of the difficulties is getting event data from a web page. 

Currently, we use an ActiveX control linked to Internet Explorer, so C$GETEVENTDATA provides what we need.  We want to use WEB-BROWSER2 and get away from ActiveX.  How do I get event data using the new browser control?

Parents
  • Suggested Answer

    0

    Have you taken a look at the 10.5.0 sample web-browser2.cbl. 

    03 wb-1 web-browser2
    event procedure is browser-event-handler.

    browser-event-handler.
    evaluate event-type

       when MSG-WB-MESSAGE-RECEIVED

    MSG-WB-MESSAGE-RECEIVED - a message was received from the web
      page. There are three types of messages: source, JSON, and
      string. The event-data-1 will be 0, and event-data-2 will
      be a flag saying which were received. This is a bitfield
      (because more than one type of message can be received at
      one time). W2F-HAVE-SOURCE (value 1) will be set if you can
      query the source, W2F-HAVE-JSON (value 2) will be set if you
      can query the JSON string, and W2F-HAVE-STRING (value 4)
      will be set if you can query the string. A value of 7 means
      you can query any of them, and a value of 5 means that you
      can query the source and the string, for example.

    The docs have the valid events for web-browser2.

    SW Engineering(QA)  

    Although I am an OpenText employee, I am speaking for myself and not for OpenText.
    If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button

  • 0 in reply to 

    I've looked at browser2.cbl which only references msg-wb-before-navigate, msg-wb-navigate-complete, and msg-wb-title-change.  I did not receive web-browser2.cbl.  I tried adding MSG-WB-MESSAGE-RECEIVED to BROWSER-1-EVENTS, but events are not being triggered when interacting with the web page.  The only event types recorded are 16429 (MSG-WB-BEFORE-NAVIGATE),16435 (MSG-WB-TITLE-CHANGE), and 16430 (MSG-WB-NAVIGATE-COMPLETE).

    This is how the new browser is set up in the screen section:

    This is how it is set up using the old browser control:

    When I click on an icon, browser-1-events does not execute.

Reply
  • 0 in reply to 

    I've looked at browser2.cbl which only references msg-wb-before-navigate, msg-wb-navigate-complete, and msg-wb-title-change.  I did not receive web-browser2.cbl.  I tried adding MSG-WB-MESSAGE-RECEIVED to BROWSER-1-EVENTS, but events are not being triggered when interacting with the web page.  The only event types recorded are 16429 (MSG-WB-BEFORE-NAVIGATE),16435 (MSG-WB-TITLE-CHANGE), and 16430 (MSG-WB-NAVIGATE-COMPLETE).

    This is how the new browser is set up in the screen section:

    This is how it is set up using the old browser control:

    When I click on an icon, browser-1-events does not execute.

Children
  • 0 in reply to 

    Attaching a zipfile. Sample web page WebEvents.html has a Click me button. browser2.cbl loads that webpage (for my program I made a C:\ftc directory and placed the htm file there. I added the  when MSG-WB-MESSAGE-RECEIVED
    display message box event-data-2  and a screen shot showing that the program received the event and displayed the event-data-2 value.

    br2-event.zip

    SW Engineering(QA)  

    Although I am an OpenText employee, I am speaking for myself and not for OpenText.
    If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button