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

Return Type for Radopen()

3 Answers 145 Views
Window
This is a migrated thread and some comments may be shown as answers.
Bose
Top achievements
Rank 1
Bose asked on 31 Jul 2009, 07:36 PM

Hi

I am having a scenario to Show modalDialog in my application and have the following code implemented.

var returnValue = window.showModalDialog(url.value, 'Transaction', 'dialogHeight:202px;dialogWidth:300px;');

If(returnValue)
 return 1;
else
 return 0;

In order to have the same look and feel as that of rad Confirmation messages. I am planning to change the ShowModalDialog to
var oWin = window.radopen()

But my screen is giving some wired behaviour.

I  need to return boolean value from this radopen and based on that i need to perform some functionality
Can you provide me some KB Article or code which would do the above functionality with radopen function.

Moreover when i use the radopen function to open a window the background operation doe not seems to wait till i complete the operation in the model dialog window.

And I am sure that i have enabled the model=true property in RadWindowManager.

Please suggest me some other approach where i could get boolean return type for the radOpen

Regards
Bose Thirumalai

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 03 Aug 2009, 01:28 PM
Hi Bose,

As noted in the documentation and in the demos, the RadWindow dialog cannot block the execution thread - that is why in the radconfirm and radprompt functions we are using a callback function - more information on the subject is available here.
In your case I would suggest to use radconfirm() - you should place the rest of the code that you wish to be executed after the dialog is closed in the callback function. If you insist to use radopen() however, I suggest to examine this demo that shows how to return values from RadWindow dialog. Again, the rest of the code should be placed in a separate function declared in the OnClientClose eventhandler.

Sincerely yours,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Bose
Top achievements
Rank 1
answered on 04 Aug 2009, 05:58 PM
Hi Georgi

 Thanks for your earlier reponse.
 I have seen both the demos, but the problem in using radconfirm in my application is i have multiple radwindowmanagers in my application and my application framework opens in an IFrame, so my callbackfunction in the radconfirm is not working because my radconfirm is using the first radconfirm that is already rendered in a page.
I think i need to use some other approcah to achieve this functionality.
Let me know if there is a work around to get radconfirm when there are multiple radwindowmanager.
And one more thing is dont have all the radwindowmanager in the same page, so please let me know if there are some KB article which will give better Demos on the same (or) some code sample which will give me better understanding to implement the same in my application.

Regards
Bose Thirumalai 
0
Georgi Tunev
Telerik team
answered on 05 Aug 2009, 11:15 AM
Hi Bose,

Yes, all RadWindowManager-specific functions (radopen, radalert, radconfirm, GetRadWindowManager, etc.) are using the RadWindowManager that is rendered first on the page.
If you want your radconfirm function to use specific callback function only, I suggest to declare the callback function directly inside the one that you use to call radconfirm.
e.g.:
function openconfirm() 
    function callbackFn(arg) 
    { 
        alert(arg) 
    } 
 
    radconfirm('radconfirm message', callbackFn) 

As for your exact setup, I am not quite sure that I understand it correctly, so if you still experience problems it will be best to open a support ticket and to send me a sample project that reproduces your setup and the problem itself. I will check it and do my best to help.


Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Window
Asked by
Bose
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Bose
Top achievements
Rank 1
Share this question
or