about radwindow openning function

5 posts, 0 answers
  1. Webster Velasco
    Webster Velasco avatar
    114 posts
    Member since:
    Jun 2012

    Posted 11 Dec 2009 Link to this post

    hi

    im using radwindow on my project but i encountered a problem while using the client side event
    here is my problem:

    actually i wanted to do some test before my radwindow pops up, but it doesnt work..
    even my test made is true, the radwindow still popping up.

    how could i exit the function when my if instruction is true?

    here is my code of the function:
             function OpenWin1(StoredP) 
                { 
                    var parentPage = GetRadWindow().BrowserWindow; 
                    var parentRadWindowManager = parentPage.GetRadWindowManager(); 
                    var paramControl = document.getElementById("<%= txtPROGRESSIVOCAMPO.ClientID %>"); 
                                     
                        if (paramControl.value != null){ 
                            var param = "ZoomSTD.aspx?rwd=rwdUTECampi&SPZoom="+StoredP+"&PF="+paramControl.value; 
                        } 
                        else 
                        { 
                            var param = "ZoomSTD.aspx?rwd=rwdUTECampi&PF=&SPZoom="+StoredP; 
                        } 
         
                    document.getElementById('btnHidden').click(); 
                     
                    //faccio un controllo se la creazione della sessione non si è verificata un'errore 
                    if (document.getElementById("ErrMsg").value != "") return false; 
                    // se c'è un'errore non apro il pop up e esco dalla funzione 
                                                     
                    var oWnd2 = parentRadWindowManager.open(param, "rwdCodiceProgCampo"); 
                       
                    window.setTimeout(function() 
                    { 
                        oWnd2.setActive(true); 
                    },0);                                               
                } 

    i need help ASAP

    thanks

    regards
    webster
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 11 Dec 2009 Link to this post

    Hi Webster,

    If I understand your logic correctly, you want to open RadWindow only if ErrMsg returns empty string. If so, you should put the code that opens the RadWindow in the else statement of the if.

    Regards,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Webster Velasco
    Webster Velasco avatar
    114 posts
    Member since:
    Jun 2012

    Posted 11 Dec 2009 Link to this post

    its still not working

    i try to w/ this but same result check the code plz
             function OpenWin1(StoredP) 
                { 
                    var parentPage = GetRadWindow().BrowserWindow; 
                    var parentRadWindowManager = parentPage.GetRadWindowManager(); 
                    var paramControl = document.getElementById("<%= txtPROGRESSIVOCAMPO.ClientID %>"); 
                                     
                        if (paramControl.value != null){ 
                            var param = "ZoomSTD.aspx?rwd=rwdUTECampi&SPZoom="+StoredP+"&PF="+paramControl.value; 
                        } 
                        else 
                        { 
                            var param = "ZoomSTD.aspx?rwd=rwdUTECampi&PF=&SPZoom="+StoredP; 
                        } 
         
                    document.getElementById('btnHidden').click(); 
                     
                    //faccio un controllo se la creazione della sessione non si è verificata un'errore 
                    var msg = document.getElementById("ErrMsg").value; 
                    if (msg == "") 
                    { 
                                     
                        var oWnd2 = parentRadWindowManager.open(param, "rwdCodiceProgCampo"); 
                           
                        window.setTimeout(function() 
                        { 
                            oWnd2.setActive(true); 
                        },0);    
                    }                                            
                } 

    i call the fycntion this way
    OnClientClick="OpenWin1('ESCCampi_Zoom'); return false;" 

    if msg is not "" the radwindow should not open w/ that code right?..
    but how my radwindow poped up when msg was not = to  ""?






  5. Webster Velasco
    Webster Velasco avatar
    114 posts
    Member since:
    Jun 2012

    Posted 14 Dec 2009 Link to this post

    i still need answer plz
  6. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 14 Dec 2009 Link to this post

    Hello Webster,

    With your current logic, RadWindow will open if the msg's value returns empty string. If you want to open the RadWindow only if msg's value is not empty, you should put the RadWindow's opening code in the else statement.
    e.g.
    var msg = document.getElementById("ErrMsg").value;
    if (msg == "")
    {
        //the msg's value property returns and empty string
        //your code for such scenario here
     
    }         
    else
    {
        //the msg's value is not empty
        //open RadWindow then
        var oWnd2 = parentRadWindowManager.open(param, "rwdCodiceProgCampo");
        window.setTimeout(function()
        {
            oWnd2.setActive(true);
        },0);   
    }

    If you still experience problems with this, please open a support ticket and send a full project that can be run locally so I can check it.

     


    Best wishes,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017