Results 1 to 5 of 5

Thread: Sending a message to a DD & Screen refresh

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Pine Island, Forida
    Posts
    2,076

    Default Sending a message to a DD & Screen refresh

    We are doing our first Webap Ajax experiment and would appreciate some help on two topics.

    1. We have created a form with a wizard, added a button that makes an AJAX call to the Webap to do something. After the call completes we would like to proceed to another page. Our code to make the call is:
    Code:
    function fUpdateLoc(sLoc) {
    document.getElementById('LocDiv').innerHTML = sLoc;
     }
    function call_SetLoc(sNewLoc){
        var oCall;
        
        oCall = new vdf.ajax.VdfCall("oAjaxTest","get_SetLoc");    
        oCall.onFinished.addListener(handleResponse);
        oCall.addParameter(sNewLoc,sNewLoc)
        oCall.send(true);
    }
    function handleResponse(oEvent){
        var sResult = oEvent.oSource.getReturnValue();
        
        if(sResult !== ""){
            fUpdateLoc(sResult);
            ' AT THIS POINT WE WOULD LIKE TO move to another webpage
        }else{
            fUpdateLoc("Error retrieving Loc !");
        }
    }
    2. The second questions is how do we send a message to the DD to clear itself. Same as clickiing on the clear (eraser)button.

    Thanks
    fv
    Last edited by FrankValcarcel; 16-Sep-2011 at 03:28 PM. Reason: spelling
    Frank Valcarcel
    Cove Systems, Inc.
    Pine Island, Florida USA
    fv@covesys.com
    (239) 823-7976

  2. #2
    Join Date
    Feb 2009
    Location
    SW Connecticut/NY area
    Posts
    9,181

    Default Re: Sending a message to a DD & Screen refresh

    Hi Frank
    1. Check out window.open(). There's an argument for opening in a completely new page -- target=_blank. Of course you didn't specify what you want to show on that new page so you might want to pass something on the address line which would be one of the arguments you can use.

    2. vdf.getForm('my_form').doClear() -- vdf.getForm('my_form') will get the id of the <form> tag using the name, and then the clear function.

    -Bob
    Bob Worsley
    203-249-2633
    rlworsley at gmail.com

    Do or do not. There is no try. — Yoda

  3. #3
    Join Date
    Feb 2009
    Location
    Pine Island, Forida
    Posts
    2,076

    Default Re: Sending a message to a DD & Screen refresh

    Thank you very much, helped a lot. Can you also provide info as how to get the value of a form window in JavaScript. What I want to do is get the value of a form window after a button press so I can send it back to a fucntion in Webapp.
    fv
    Frank Valcarcel
    Cove Systems, Inc.
    Pine Island, Florida USA
    fv@covesys.com
    (239) 823-7976

  4. #4
    Join Date
    Feb 2009
    Location
    SW Connecticut/NY area
    Posts
    9,181

    Default Re: Sending a message to a DD & Screen refresh

    Sure. There are two ways, either with the JavaScript DOM or through the Ajax API. The following is just grabbing the value via the DOM, similar to the VDF "get value..."

    In the control you want to grab the value from, define an id: id="someId"

    In javascript:
    var MyId = document.getElementById("someId").value;

    Set the value in the opposite way
    var someOtherId = "blah";
    document.getElementById("someId").value = someOtherId;

    Using the API is a different level of complexity though not difficult, just takes some learning.
    Bob Worsley
    203-249-2633
    rlworsley at gmail.com

    Do or do not. There is no try. — Yoda

  5. #5
    Join Date
    Feb 2009
    Location
    Pine Island, Forida
    Posts
    2,076

    Default Re: Sending a message to a DD & Screen refresh

    You da bomb!
    Thanks
    fv
    Frank Valcarcel
    Cove Systems, Inc.
    Pine Island, Florida USA
    fv@covesys.com
    (239) 823-7976

Tags for this Thread

Posting Permissions

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