Liquid UI - WS Reference Library

connectHTML()


Purpose

With connectHTML(), you can work with the values from HTML pages rendered using Control() or View() commands.

Using connectHTML() command, you can read the values from the HTML pages, change values, clicking a link on HTML page, integrate the display via  Control() or  View() with the SAP screen or create a separate "floating" window.

connectHTML() command works with your own HTML pages, internet and intranet pages.


Syntax

connectHTML({options})

For example -

connectHTML(click:"submit_login")

connectHTML({shownnames:true})


Available Options

You can use the following options with the connectHTML:

"name":".."

{control.. name= } - Specification of the control name.

"window":".."

{View.. returnwindow= statement} - Specification of the window number returned by.

"click":".."

(click:"Element") - To set the name of the HTML element (e.g. a button, an image or a link) to click.

"seturl":".."

Displays the HTML page with the given URL.

"gettitle":".."

Return the page title.

"settitle":".."

Set the new page title.

"listelements":".."

This option shows all HTML elements of the current page in the given text variable.

"shownames":".."

This option displays name of each HTML element as a 'tootip' on the HTML page on mouse hover

 

Scenario

OpenLiquid UI Designer and select HTML control and click on screen.

  • Right click for properties
  • specify the website to be displayed
  • save the script and see the changes on SAP Easy Access Screen.


Script

clearscreen();
if((z_guixtcrm_user == "pooja" || z_guixtcrm_user == "pooja") && z_guixtcrm_pass == "guixt100")
{
set("V[link_icwc]","http://mamba/guixtcrm/");
view([0,0],[20,120],"&V[link_icwc]",{name:"z_guixt_html"});
if(htmlExists("text_text"))
{                                                              
// tests if "text_text" exists in the HTML page now.
        //textbox([0,130],[30,180],{name:"z_longtext"});                                                
 // limitation, longtext cannot display more than 2048 characters at a time.       
set("html[text_text]",z_guixtcrm_user);                                                          
// sets USERNAME z_guixtcrm_user
   set("html[password_user_password]",z_guixtcrm_pass);                                            
// sets PASSWORD z_guixtcrm_pass
    set("V[z_test_get_html]","&html[text_text]");                                                    
// gets USERNAME into variable z_test_get_html
     println("\n\n---------------\n\n"+"z_test_get_html is:"+z_test_get_html+"\n\n---------------\n\n");    
// check if get was successful
     //connectHTML("z_guixt_html",{click:"submit_login",listelements:"z_longtext"});    
                // click on the button and also lists elements inside the longtext
      connectHTML({click:"submit_login"});                                                             
 // click on the button "submit_login"
   }
}
 else
 {
     set("V[crmuser]","pooja");
     set("V[crmpass]","guixt100");
    view([0, 0], [20, 120], "test_WS.html", {name:"z_guixt_html", executeJS:"externalFLogon('&V[crmpass]', '&V[crmpass]')", s10logon:true}); 
 // will execute JAVASCRIPT in html document test_WS.html with params
 }
 connectHTML({shownames:true});
 function single_signon(){
    println("Executing single_signon");
     view([15.5,20.6],[19.5,28.6],"http://www.guixt.com/",{"floating":true,"maximize":true, name:"thisisbozopopup"});
    onscreen 'ZGUIXT.0100'
        println("\nExecuting onscreen 1 for single_signon");
         enter();
    onscreen 'ZGUIXT.0100'
        println("\nExecuting onscreen 2 for single_signon");
        enter();
 }