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

Returning args from closed window

1 Answer 109 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jacques
Top achievements
Rank 1
Jacques asked on 10 Jul 2008, 08:29 PM
Having a problem is returning the a value when closing a window.

The parent page is set up using the RadWindowManager

<telerik:RadWindowManager ID="RadWindowManager1" runat="server">

<Windows>

<telerik:RadWindow runat="server" Behavior="Default" InitialBehavior="None" Left=""

Modal="True" NavigateUrl="GroupSearchPopup.aspx" OpenerElementID="<%# lnkGroupSearch.ClientID %>"

Style="display: none;" ReloadOnShow="true" ClientCallBackFunction="OnGroupCallback"

Title="Donation Group Search" Top="" Width="450px" Height="300px" ID="rwGroupSearch">

</telerik:RadWindow>

<telerik:RadWindow ID="rwDonorSearch" runat="server" Behavior="Default" Width="550px"

Height="500px" InitialBehavior="None" Left="" Modal="True" NavigateUrl="DonorSearchPopup.aspx"

ReloadOnShow="true" OnClientClose="OnDonorSearchClose" Style="display: none;"

Top="" OpenerElementID="<%# lnkPersonSelect.ClientID %>"

OnClientDragEnd="OnClientDragEnd">

</telerik:RadWindow>

</Windows>

</telerik:RadWindowManager>


Parent client side code to handle the Window close

function OnDonorSearchClose(sender, eventArgs) {

alert(

"action on close = " & eventArgs);

oValue = eventArgs;

if (oValue.action > 0) {

// Set a hidden field to the value

document.getElementById(

'<%= Me.hfPersonID.ClientID %>').Value = oValue;

document.getElementById(

'<%= Me.btnScriptUpdate.ClientID %>').click();

}

}

Modal window client code

 

function CloseWithArg(sender, eventArg) {

var currentWindow = GetRadWindow();

alert(

"Arg = " + eventArg);

currentWindow.argument = eventArg;

currentWindow.close();

}

The alert in the modal CloseWithArg function displays the correct value

but the alert on the parent OnDonorSearchClose function displays only a 0. Even the text portion of the alert is not displayed.

Any hints as to what I'm doing wrong?

Thanks

Jacques

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 11 Jul 2008, 12:28 PM
Hello Jacques,

You need to use sender.argument for retrieving the argument in OnDonorSearchClose(). eventArgs in this case is not used - the argument is set to the RadWindow object.

I hope this helps.


Greetings,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Window
Asked by
Jacques
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or