Open Radwindow From Radwindow

13 posts, 0 answers
  1. Raj
    Raj avatar
    34 posts
    Member since:
    Sep 2012

    Posted 20 Oct 2010 Link to this post

    Hi,

    I have two pages. Details and orderdetails. In Details page i have radwindow with window manager. I am opening orderdetails page using iframe in details page. See code below.

    <telerik:RadWindowManager ID="RadWinManager" runat="server" OnClientDragStart="WindowDragStart"
        OnClientResize="WindowDragStart" OnClientResizeStart="WindowDragStart" OnClientResizeEnd="WindowDragStart">
        <Windows>
            <telerik:RadWindow ID="DetailRadWind" runat="server" ShowContentDuringLoad="false"
                BackColor="Green" Behaviors="Default" Animation="FlyIn" Skin="Forest">
                <contenttemplate>
                                <div>
                                    <iframe frameborder="0" style="width: 100%; height: 100%; border-style: none; border-width: 0px"
                                        id="ifrmRadWin" runat="server"></iframe>
                                </div>
                            </contenttemplate>
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    ScriptManager.RegisterClientScriptBlock(this.up, this.GetType(), "strSearSiteName", "document.getElementById('ctl00_PagePlaceholder_DetailRadWind_C_ifrmRadWin').src='OrdDet.aspx'", true);
                    LinkButton lnkSiteName = (LinkButton)rw.FindControl("lnkSiteName");
                    string Title = "Order Details : " + lnkSiteName.Text;
                    ScriptManager.RegisterClientScriptBlock(this.up, this.GetType(), "BlkRejection", "OpenSiteWindow('" + Title + "')", true);
    function OpenSiteWindow(Title) {
        var WinTitle = Title;
        var oWnd = GetRadWindowManager().GetWindowByName("DetailRadWind");
        oWnd.set_width(810);
        oWnd.set_height(580);
        oWnd.set_title(WinTitle);
        var radwind = window.radopen("", "DetailRadWind");
     
    }

    once i clikc the button in details page radwindow will open and displays the data in orderdetails page. And i have another radwindow in orderdetails page.(this window is in orderdetails page). once the popup comes up i have reject button in it. and if i click the reject button anthoer window will open. Now the problem is How to open the window that is orderdetails page. i tried to do it on visibleonpageload = true. but its loading on every pageload. How to open this window using javascript.

    Here is orderdetails Page

    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="smOrddet" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="upOrdTsk" runat="server">
            <ContentTemplate>
                <div>
                    Some HTML Code HERE</div>
                <telerik:RadWindow ID="RadWinReject" runat="server" Height="340px" Width="515px"
                    Title="Bulk Task Completion" Behaviors="Default" CustomCSS="CSS/CustomStyle.css"
                    ShowContentDuringLoad="false" BackColor="Green" Animation="FlyIn" Skin="Forest">
                    <contenttemplate>
                        <asp:UpdatePanel ID="uprej" runat="server" OnUnload="Registerpanel5">
                            <ContentTemplate>
                            <div>Some HTML HERE</div>
                              </ContentTemplate>
                        </asp:UpdatePanel>
                    </contenttemplate>
                </telerik:RadWindow>
            </ContentTemplate>
        </asp:UpdatePanel>
        </form>
    </body>
  2. Raj
    Raj avatar
    34 posts
    Member since:
    Sep 2012

    Posted 20 Oct 2010 Link to this post

    i tried this way but getting error like "oBrowserWnd" is null

    in code behind
    ScriptManager.RegisterClientScriptBlock(this.upOrdTsk, this.GetType(), "strSearCkts", "OpenPopUp()", true);
    in javascript

    function OpenPopUp() {
                var oBrowserWnd = GetRadWindow().BrowserWindow;
                oBrowserWnd.radopen("", "RadWinReject");
            }
            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow)
                    oWindow = window.radWindow;
                else if (window.frameElement.radWindow)
                    oWindow = window.frameElement.radWindow;
                return oWindow;
            }

  3. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 25 Oct 2010 Link to this post

    Hi Raj,

    I am not sure that I understand your scenario completely, but in general, if a RadWindow declared in a RadWindowManager is showing up on every postback, you need to set the manager's EnableViewState property to false.
    As for opening with JavaScript, if you want to open the window that is in the topmost page, you could use top.radopen(...) where top refers to the topmost (i.e. the one opened directly in the browser) page.

    I hope this helps. If you still experience problems, please open a support ticket and send a sample project that will give us a better view over your exact setup and logic.

    P.S. I noticed that you use a content template with an IFRAME in it. If you want to load an external page in RadWindow, you only need to set its NavigateUrl property - there is no need to use content template for that purpose.

    Kind regards,
    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
  4. Raj
    Raj avatar
    34 posts
    Member since:
    Sep 2012

    Posted 25 Oct 2010 Link to this post

    Hi Georgi Tunev ,

    That means if i want open the window in orderdetails page i need to call like top.radopen(.....). ??
  5. Raj
    Raj avatar
    34 posts
    Member since:
    Sep 2012

    Posted 25 Oct 2010 Link to this post

    Hi Georgi Tunev ,

    when i wrote like  top.radopen("", "RadWinReject");..... but its opening empty radwindow. No content in it.

    P.S. I noticed that you use a content template with an IFRAME in it. If you want to load an external page in RadWindow, you only need to set its NavigateUrl property - there is no need to use content template for that purpose.

    for above i am opening different pages according to user selection. So i cant define navigateurl in the code.
  6. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 26 Oct 2010 Link to this post

    Hi Raj,

    You can easily change the opened page in a shown RadWindow by getting reference to it and then call its setUrl() method. As for the problem itself, please open a support ticket and send me a sample project - I will check it and get back to you with a solution.

    Greetings,
    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
  7. Srinivasa Gokidi
    Srinivasa Gokidi avatar
    15 posts
    Member since:
    Jun 2010

    Posted 26 Oct 2010 Link to this post

    Hi Georgi Tunev,

    This is Raj. How to post code in the forum. do i need to send data database also? Please let me know.

    Thanks
  8. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 27 Oct 2010 Link to this post

    Hello Raj,

    I recommend to open a support ticket from the account that you currently use and to send the sample project there. As for the database - if it is not used for reproducing the problem, there is no need to send it. This blog post might help you isolate the problem quicker.


    Thank you for your patience and cooperation.

    Greetings,
    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
  9. Srinivasa Gokidi
    Srinivasa Gokidi avatar
    15 posts
    Member since:
    Jun 2010

    Posted 27 Oct 2010 Link to this post

    HI Georgi Tunev,

    I already posted the code. My ticket ID is: 361144. Please let me know if you need anything.
  10. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 28 Oct 2010 Link to this post

    Hello Raj,

    I see that Fiko already answered your support ticket. For convenience I am pasting his reply below:

    Hello Raj,

    The problem was caused by these setups in your page:
    • The RadWindow was wrapped in an UpdatePanel. Please note that if you wrap the window in update panel, then it will be closed every time a postback occurs inside the wrapper UpdatePanel
    • In .NET35 if you disable the ViewState of a control, then this will be applied to its child controls. in your scenario, the RadWindow is a parent for all controls inside its ItemTemplate and this is why they inherit its EnableViewState="false" setting. This cause the DropDownList controls.
    The solution in your case is to exude the RadWindow control from the partially updated requisition and set its EnableViewState="true" property (it is true by default). As alternative to the last suggestion you can update your project to .NET40, so you can specify the EnableViewState property for every control independently.
    For your convenience I have attached the modified version of your project.

    In addition, I believe that the information provided in this KB article will be of help for you.



    Sincerely yours,
    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
  11. Srinivasa Gokidi
    Srinivasa Gokidi avatar
    15 posts
    Member since:
    Jun 2010

    Posted 28 Oct 2010 Link to this post

    Georgi Tunev,

    Its working. But for each and every operation the page is refreshing. Can we achieve the same thing by placing the code in updatepanel. I can takeout radwindow from update panel. If you run my code you will see so many tabs, for each event in those tabs my page is refreshing. I tried to put all those tabs in updatepanel except the reject button. It works too but for each and every tab i am opening another window. can we open the window using javascript  by placing the code in updatepanel.? 

    I Hope you understand my issue.

    Thanks
    Babu
  12. Srinivasa Gokidi
    Srinivasa Gokidi avatar
    15 posts
    Member since:
    Jun 2010

    Posted 29 Oct 2010 Link to this post

    Hi Georgi Tunev,

    Atlast i made it work. It is working fine without any page refreshing.... But i have one more problem. I am binding the data to the dropdownlist in code behind. Here is code...

    try
           {
               clsTaskUpdates_BL objBL = new clsTaskUpdates_BL();
               DataSet dsResTasks = objBL.getRejectTasks_BL(Convert.ToInt32(Session["TaskID"]), Convert.ToInt32(Session["selorderID"]));
               ddlRejTask.DataSource = dsResTasks.Tables[0];
               ddlRejTask.DataTextField = "tskName";
               ddlRejTask.DataValueField = "qid";
               ddlRejTask.DataBind();
               ddlRejTask.Items.Insert(0, "");
     
               ddlRejTskReason.DataSource = dsResTasks.Tables[1];
               ddlRejTskReason.DataTextField = "tskRejectReason";
               ddlRejTskReason.DataValueField = "trrid";
               ddlRejTskReason.DataBind();
               ddlRejTskReason.Items.Insert(0, "");
     
               Session["RejRootCause"] = dsResTasks.Tables[2];
               ddlRejTskRootCause.Attributes.Add("onclick", "javascript:return ddlRejRea()");
               Session["factionType"] = "2";
               btnRejTsk.Text = "Reject Task";
               ScriptManager.RegisterClientScriptBlock(this.upOrdTsk, this.GetType(), "strSearCkts", "OpenPopUp()", true);
                
           }
           catch (Exception ex)
           {
           }


    My issue is if i use radwindow manager "ddlRejTask.Items.Insert(0, "");" is not working. (Please see image) But if i remove radwindowmanager its adding the initial item. I think radwindowmanager blocking that item. How to achieve this with radwindowmanager. I put enableviewstate = true in the page directive, in dropdownlist, in radwindow and radwindowmanager. But nothing works. Can you help me how to fix this....

    here is my aspx code.....

    <body>
        <form id="form2" runat="server">
        <asp:ScriptManager ID="smOrddet" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="upOrdTsk" runat="server">
            <ContentTemplate>
                <div style="background-color: White; border-color: #68af3a; border-width: 0; border-style: solid">
                    <div style="padding-top: 5px; width: 97%; padding-left: 14px;">
                        <table class="customFont" width="100%">
                            <tr>
                                <td>
                                    <table width="100%">
                                        <tr>
                                            <td align="right">
                                                <table cellspacing="2">
                                                    <tr>
                                                        <td>
                                                            <asp:Button ID="btnResch" OnClick="btnResch_Click" Width="120px" runat="server" Text="Site Reschedule" />
                                                        </td>
                                                        <td>
                                                            <asp:Button ID="btnReject" Width="120px" OnClick="btnReject_Click" runat="server"
                                                                Text="Reject Task" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                            </tr>
                        </table>
                    </div>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
        <telerik:RadWindowManager ID="OrdRadWM" EnableViewState="true" runat="server">
            <Windows>
                <telerik:RadWindow ID="RadWinReject" runat="server" Height="340px" Width="515px"
                    Title="Bulk Task Completion" Behaviors="Default" CustomCSS="CSS/CustomStyle.css"
                    ShowContentDuringLoad="false" BackColor="Green" Animation="FlyIn" Skin="Forest"
                    EnableViewState="true">
                    <ContentTemplate>
                        <asp:UpdatePanel ID="uprej" runat="server" OnUnload="Registerpanel5">
                            <ContentTemplate>
                                <div style="padding-top: 5px; padding-bottom: 20px; padding-right: 20px; padding-left: 20px;">
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:RequiredFieldValidator BackColor="Yellow" Font-Bold="true" ID="custSt" runat="server"
                                                    Font-Size="8pt" ValidationGroup="rejTsk" ControlToValidate="ddlRejTask" InitialValue="0"
                                                    ErrorMessage="Please select the Rejected Task ."></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left">
                                                Reject to the following Task
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left">
                                                <asp:DropDownList ID="ddlRejTask" ValidationGroup="rejTsk" Width="450px" runat="server">
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:RequiredFieldValidator BackColor="Yellow" Font-Bold="true" ID="RequiredFieldValidator1"
                                                    runat="server" Font-Size="8pt" ValidationGroup="rejTsk" ControlToValidate="ddlRejTskReason"
                                                    InitialValue="0" ErrorMessage="Please select the Rejected Reason ."></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left">
                                                Task Reject Reason
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left">
                                                <asp:DropDownList ID="ddlRejTskReason" AutoPostBack="true" OnSelectedIndexChanged="ddlRejTskReason_SelectedIndexChanged"
                                                    Width="450px" runat="server">
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" Font-Bold="true" BackColor="Yellow"
                                                    runat="server" Font-Size="8pt" ValidationGroup="rejTsk" ControlToValidate="ddlRejTskRootCause"
                                                    InitialValue="0" ErrorMessage="Please select the Rejected Root Cause ."></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr style="display: none" id="trTskRejReaMsg">
                                            <td>
                                                <asp:Label ID="lbltskRejMsg" BackColor="Yellow" Font-Bold="true" Font-Size="8pt"
                                                    ForeColor="Red" runat="server" Text="Please select Task Reject Reason"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left">
                                                Task Reject Root Cause
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left">
                                                <asp:DropDownList ID="ddlRejTskRootCause" Width="450px" runat="server">
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left">
                                                Other Reason/Root Cause
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left">
                                                <asp:TextBox ID="txtOthReaRootCause" Width="444px" runat="server" TextMode="MultiLine"
                                                    Rows="3"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                <asp:Button ID="btnRejTsk" runat="server" ValidationGroup="rejTsk" OnClick="btnRejTsk_Click"
                                                    Text="Reject Task" /> 
                                                <asp:Button ID="btnRejCancel" runat="server" OnClientClick="clsPopUpRej()" Text="Cancel" />
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </ContentTemplate>
                </telerik:RadWindow>
                <telerik:RadWindow ID="RadWinAttchment" runat="server" Height="420px" Width="520px"
                    Title="Add Attachment" Behaviors="Default" CustomCSS="CSS/CustomStyle.css" ShowContentDuringLoad="false"
                    BackColor="Green" Animation="FlyIn" Skin="Forest" EnableViewState="true" NavigateUrl="Upload.aspx">
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
        <asp:UpdateProgress ID="UpdateProgress2" AssociatedUpdatePanelID="upOrdTsk" DisplayAfter="1"
            runat="server">
            <ProgressTemplate>
                <iframe frameborder="0" src="about:blank" class="iframestyle"></iframe>
                <div class="iframeDiv">
                    <img src="Images/rotate_large.gif" alt="" />
                </div>
                <div>
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
        </form>
    </body>



    Thanks
    Babu
  13. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 03 Nov 2010 Link to this post

    Hi Babu,

    The project that was sent in the support ticket was quite complex and I am not sure if the current problem is related to the latest changes that you did on them. Please send the updated project in the support ticket that is already opened and we will check it.


    Sincerely yours,
    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