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

radprompt and callerObj

3 Answers 119 Views
Window
This is a migrated thread and some comments may be shown as answers.
John Brownell
Top achievements
Rank 1
John Brownell asked on 09 Dec 2008, 07:01 PM
In the documantation for the RadWindow radprompt, there is indication of the ability to pass additional data to the callback function:

callerObj
- provides ability to "pass" a reference to  a HTML object, such as button to the callback function.

All of the examples I can find pass null and do not use this object. Can someone provide an example of how to retrieve this additional data from the callback? When I break inside the function, all I can see is the first argument - text only - text entered into the prompt dialog.

Thanks!
John

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 10 Dec 2008, 03:23 PM
Hi John,

You can see an example of how callerObj is used in this Code Library article:
http://www.telerik.com/community/code-library/aspnet-ajax/window/block-the-execution-thread-with-radconfirm.aspx

Could you please tell me what exactly you want to achieve? I am asking you this because callerObj can be used in several scenarios only and in fact the text that you found in the documentation should have been already removed. If you provide me with details about your scenario, I will do my best to help you.


All the best,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
John Brownell
Top achievements
Rank 1
answered on 10 Dec 2008, 04:38 PM
Thanks for the response.

Actually, what I am trying to do is add a prompt dialog into the OnClientPasteHtml event in the RadEditor - something very similar to the example here:

http://www.telerik.com/support/kb/aspnet-ajax/sharepoint/how-to-execute-custom-code-called-on-radeditor-s-events.aspx

But, I want to replace the generic javascript prompt dialog with the RadWindow radPrompt dialog. Since the radPrompt uses a Callback handler, I figured I could pass some bit of info using that callerObj in the callback method. Perhaps I am going down the wrong path? Any suggestions?

Thanks!

John
0
Georgi Tunev
Telerik team
answered on 11 Dec 2008, 02:15 PM
Hi John,

You can do this by declaring the callback function inside the one that you use to call radprompt:
<script type="text/javascript" language="javascript"
function callPrompt(promptQ, otherInfo) 
    function CallbackFn(arg) 
    { 
        alert("The question was: " + promptQ + "; The answer was: " + arg + "; the extra info was: " + otherInfo);  
    } 
     
    radprompt(promptQ,CallbackFn);  
 
    </script> 
<button onclick="callPrompt('Are you sure?','other info'); return false;">call radprompt</button> 




I hope this helps.

Regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
John Brownell
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
John Brownell
Top achievements
Rank 1
Share this question
or