Scan or input host address and connect the session

Version 2

    Verified Product Versions

    Wavelink Naurtech CETerm 5.7

    This is a sample script which is part of a simple web page. It allows you to scan or type in a host address. The session is then connected to this host.

     

    This sample is implemented as a static HTML page which can be copied to the device. It uses Session 1 but this can be changed. The host IP address would be entered or scanned into the HTML page. The page will then set the hostname in Session 2 and switch to Session 2 for 5250.

     

    To download the attached..." HostConnect.htm

     

    Here are the configuration steps:

     

    • Copy the HostConnect.htm file to the root directory "\" on the device.
    • Configure Session 1
      • Host Type: HTML
      • Host Address:  file:///HostConnect.htm
    • Configure Session 2
      • Host Type: 5250

     

    • Configure Scripting. This is needed to switch back to Session 1 when Session 2 disconnects.

              Go to Session->Configure->Options->Configure Scripting-> General

      • Enable scripting
      • Enter these scripts in a script slot. The scripts are also shown as comments in the HTML page.
      • NOTE: Scripts must be marked Load at Startup

     

      function OnSessionDisconnect( session )

      {

        // Action when user disconnects session

        // Switch back to launcher page

        CETerm.PostIDA( "IDA_SESSION_S1", 0 );

      }

     

      function OnSessionDisconnected( session )

      {

        // Action when remote host disconnects session

        // Switch back to launcher page

        CETerm.PostIDA( "IDA_SESSION_S1", 0 );

      }

     

    You may want to edit the page and scripts for different actions or sessions.