This is a migrated thread and some comments may be shown as answers.

about radwindow openning function

4 Answers 32 Views
Window
This is a migrated thread and some comments may be shown as answers.
Webster Velasco
Top achievements
Rank 2
Webster Velasco asked on 11 Dec 2009, 10:44 AM
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

4 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 11 Dec 2009, 11:37 AM
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.
0
Webster Velasco
Top achievements
Rank 2
answered on 11 Dec 2009, 01:11 PM
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  ""?






0
Webster Velasco
Top achievements
Rank 2
answered on 14 Dec 2009, 09:09 AM
i still need answer plz
0
Georgi Tunev
Telerik team
answered on 14 Dec 2009, 10:51 AM
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.
Tags
Window
Asked by
Webster Velasco
Top achievements
Rank 2
Answers by
Georgi Tunev
Telerik team
Webster Velasco
Top achievements
Rank 2
Share this question
or