Want to get rid of Google Ads, click here.
+ Reply to Thread
Results 1 to 8 of 8

Thread: Open a popup window with information

  1. #1
    Junior Member
    Join Date
    Nov 2008
    Posts
    11

    Default Open a popup window with information

    Hello,

    I wonder if it is possible (I guess it will be) and how to open a popup window in an script library.
    I need to retrieve some data through a webservice (that is already working) and what I need to do is the following steps:
    - Click in a button on a form to call the script library
    - Open a JS popup window that need to contain the information retrieved

    Someone knows how to do that?

    Regards

  2. #2
    Senior Member mateuszk's Avatar
    Join Date
    Nov 2006
    Posts
    302

    Default

    I'd suggest a different approach:

    1. click on a button = call SC script (not the ScriptLibrary, but the "old skool" scripts)
    2. in the first script panel, call WS
    3. on the following panel, output the specified information on a SC form

  3. #3
    Senior Member
    Join Date
    Jan 2002
    Location
    The Netherlands
    Posts
    930

    Default

    Easiest I can see is the radcall for "mb.ok" - mb.ok allows you to pop-up a message in an "OK" only box.

  4. #4
    Junior Member
    Join Date
    Nov 2008
    Posts
    11

    Default

    Thanks a lot guys.

    Just one question: as I have currently the code to call the WS in a Script Library (this functionality is used at more places), is it possible to call in the old skool scripts to the script library througth the jscall method in the RAD tab?

  5. #5
    Senior Member mateuszk's Avatar
    Join Date
    Nov 2006
    Posts
    302

    Default

    Quote Originally Posted by jcperez View Post
    Thanks a lot guys.

    Just one question: as I have currently the code to call the WS in a Script Library (this functionality is used at more places), is it possible to call in the old skool scripts to the script library througth the jscall method in the RAD tab?
    Jscall is for the "expressions" tab, it is a function, not an application.
    You can also use javascript tabs.

  6. #6
    Junior Member
    Join Date
    Nov 2008
    Posts
    11

    Default

    I have two doubts regarding that issue:
    1.- From the do I have make the call to the script in the RAD tab as it is indicated in the help topics of SC, that is, using "script.execute" as RAD application, with value $L.filed for field file and the name of the old school script I have created in the field name. What I need to know is how to retrieve the form from the field $L.filed object (in order to get a value of a field in the form), used in the call to my Script Library I have made.
    2.- Once the script is executed and the information retrieved has been stored in the device I have no idea how to open the new SC form I have created, because the action of the button it works in the same way the Search button do.
    Last edited by jcperez; 2009-01-08 at 11:19.

  7. #7
    Senior Member fid509's Avatar
    Join Date
    Feb 2002
    Location
    Brussels
    Posts
    381

    Default

    I once reused a function that I found in the KM ScriptLibrary to display a message box using a callrad to mb.ok.
    It didn't use further because it had one disadvantage for me namely that the JavaScript does not wait until you press the OK button but it continues to execute everything that is coming after this function.

    Code:
    /*****************************************************************************************************
    *  This function will show a popup messagebox.
    *  Author: fid509
    *  Date: 20/11/2008
    *  @input  {sString} sString: the string to be displayed
    *  @output none
    *
    /****************************************************************************************************/
    
    function domessageBox(message)
    {
           
            var rteReturnValue = new SCDatum();
            var argNames = new SCDatum();
            var argVals = new SCDatum();
            argVals.setType(8);  //type Array
            argNames.setType(8); //type Array
            var argVal;
            argVal = new SCDatum();
            argVal.setType(2);      //Type string
            argVal.push("text");
            argNames.push(argVal);
            argVal = new SCDatum();
            argVal.setType(2) //Type string
            argVal.push(message);
            argVals.push(argVal);
           
            //print("argVals="+argVals);
           
            system.functions.rtecall("callrad",rteReturnValue,"mb.ok",argNames,argVals,true);
            //false to run in same thread, true to run in new thread
    
    } //end function

  8. #8
    Junior Member
    Join Date
    Nov 2008
    Posts
    11

    Default

    Hello again. Happy new year to all!!

    Now I have been able to call the script library directly from the display option, passing the $L.filed object to retrieve the fields of the SC form necessary to use in the script.

    What I have no idea to do right now is once I have made the call to the script library how to open the new SC form from the display option.
    Is there any rad function or routine to open a new SC form? Or where is specified the form that is going to be shown once a button is pressed and the associated script to that button in the do is executed?
    Thanks a lot for all of you guys and also thanks again in advance.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts