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

RadWindow clienClose Event

4 Answers 90 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ryan Pope
Top achievements
Rank 1
Ryan Pope asked on 23 Jun 2010, 02:11 PM
I am returning Customer Values using RadWindows. When I retrieve the customer infro from the RadWindow I want to make 'pnlCustomerInfoCustomerData' (panel) visible. I have been trying to do this within the "function clientClose", but not sure how to do this. I am using the ASPNET Ajax 2010 tool, any ideas would be great. The code I am using is posted below:

<telerik:radscriptblock runat="server" ID="radScriptBlock">  
        <script type="text/javascript">  
            function openCustomerLookupWindow()  
            {                    
                var txtNo = $find("<%= txtExistingCustomerSearchCustomerNo.ClientID %>");    
                var txtCoNam = $find("<%= txtExistingCustomerSearchCompanyName.ClientID %>");    
                var txtCPN = $find("<%= txtExistingCustomerSearchContactPerson.ClientID %>");    
                var txtCity = $find("<%= txtExistingCustomerSearchCity.ClientID %>");    
                var cboState = $find("<%= cboExistingCustomerSearchState.ClientID %>");    
                var oWnd = window.radopen('../../Lookups/NavCustomerLookup.aspx?navco=<%=session("SP_SearchCustomerNavCompany")%>&no=' + txtNo.get_value() + '&conam=' + txtCoNam.get_value() + '&cpn=' + txtCPN.get_value() + '&city=' + txtCity.get_value() + '&state=' + cboState.get_value() + '',"winCustomerLookup");  
                //oWnd.argument = combo.get_value();   
                oWnd.Center();  
                //oWnd.SetSize(800,500);  
            }  
              
            function clientShow(sender, eventArgs)  
            {  
                //var txtDate = $find("<%= txtExistingCustomerSearchCustomerNo.ClientID %>");    
                //sender.argument = txtDate.get_value;    
                //sender.argument = document.getElementById('<%=txtExistingCustomerSearchCustomerNo.ClientID%>').innerText;   
            }  
 
            function clientClose(oWnd,args)  
            {  
                var txtNo = $find("<%= txtExistingCustomerSearchCustomerNo.ClientID %>");    
                var txtCoNam = $find("<%= txtExistingCustomerSearchCompanyName.ClientID %>");    
                var txtCPN = $find("<%= txtExistingCustomerSearchContactPerson.ClientID %>");    
                var txtCity = $find("<%= txtExistingCustomerSearchCity.ClientID %>");    
                var cboState = $find("<%= cboExistingCustomerSearchState.ClientID %>");    
                //get the transferred arguments  
                var arg = args.get_argument();  
                if(arg)  
                {   
                    var CustomerNo = arg.CustomerNo;  
                    var CompanyName = arg.CompanyName;  
                    var ContactPersonName = arg.ContactPersonName;  
                    var CustomerCity = arg.CustomerCity;  
                    var CustomerState = arg.CustomerState;  
                      
                    txtNo.set_value(CustomerNo);  
                    txtCoNam.set_value(CompanyName);  
                    txtCPN.set_value(ContactPersonName);  
                    txtCity.set_value(CustomerCity);  
                    cboState.set_value(CustomerState);  
                    document.getElementById('pnlCustomerInfoCustomerData').style.display = 'none';            
                }  
                document.forms[0].submit();  
            }  
              
              
        </script>  
    </telerik:radscriptblock>  

This is my panel:
<telerik:radajaxpanel runat="server" LoadingPanelID="LoadingPanel" ID="AjaxPanel" Wrap="False" EnableAJAX="False">  
<asp:Panel ID="pnlCustomerInfoCustomerData" runat="server">  
</asp:Panel>  
</telerik:RadAjaxPanel> 

4 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 24 Jun 2010, 11:24 AM
Hi Ryan,

In the code that you provided the panel is visible (it is not wrapped in some container like for ex. DIV set with display:none), so I am not quite sure that I understand your setup correctly. Could you please provide more details? It will be best if you open a support ticket and send a small sample page where this issue could be reproduced. I will check it and get back to you with a solution right away.


Best wishes,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ryan Pope
Top achievements
Rank 1
answered on 24 Jun 2010, 01:10 PM
Sorry the example I did give you was incorrect for the panel, i meant to insert Visible = False
ex.
<telerik:radajaxpanel runat="server" LoadingPanelID="LoadingPanel" ID="AjaxPanel" Wrap="False" EnableAJAX="False">     
<asp:Panel ID="pnlCustomerInfoCustomerData" runat="server" Visible="False">     
</asp:Panel>     
</telerik:RadAjaxPanel>   

If I wanted to make this panel Visible="True" after I return information from the Rad Window, how would this be done?

0
Princy
Top achievements
Rank 2
answered on 24 Jun 2010, 01:39 PM
Hello Ryan,

Could you try setting the style.display property from client side than setting the Visible property of Panel control?

JavaScript:
 
    function pageLoad() {  
        document.getElementById('pnlCustomerInfoCustomerData').style.display = 'none'// Hide the panel initially  
    } 

Now you can use following client code to show the panel:
         document.getElementById('pnlCustomerInfoCustomerData').style.display = 'block';


Hope this suggestion helps.

Regards,
Princy.
0
Georgi Tunev
Telerik team
answered on 25 Jun 2010, 05:47 AM
Hi Ryan,

I agree with Princy. Note that when you set Visible=false for a control, this control will not be rendered on the page at all - i.e. you will not be able to make it visible again on the client. To avoid that you should either set the panel's style to display:none, or as an alternative - to wrap it in a DIV again with display:none and to remove that style when needed.

All the best,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Window
Asked by
Ryan Pope
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Ryan Pope
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or