RadWindow clienClose Event

5 posts, 0 answers
  1. Ryan Pope
    Ryan Pope avatar
    61 posts
    Member since:
    Apr 2008

    Posted 23 Jun 2010 Link to this post

    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> 
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 24 Jun 2010 Link to this post

    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
  3. Ryan Pope
    Ryan Pope avatar
    61 posts
    Member since:
    Apr 2008

    Posted 24 Jun 2010 Link to this post

    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?

  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 24 Jun 2010 Link to this post

    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.
  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 25 Jun 2010 Link to this post

    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
Back to Top