[CLOSED] Modal Partial view Window

  1. #1

    [CLOSED] Modal Partial view Window

    Hi I have a Viewport on the masterpage that have Tabs and a West panel Navigation panel . The tabs render the pages in IFRAME. a modal window rendered when a button is clicked on the Iframe tab page is clicked just covers the IFRAME tab area and does not cover the Viewport area of the master page. How can this be made to cover the Viewport area.

    patial view page
    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <ext:Window ID="winLicenseAdmin" runat="server" Title="<%$ Resources:WebResources|LicenseConfiguration.FormLabels, LicenseAdministrationTitle %>"
        Resizable="false" Modal="true" Height="580" Width="800" Border="False" Hidden="false">
        <Items>
            <ext:Panel runat="server" Cls="topPanel" Height="85" BodyStyle="padding:15px 10px 15px 10px;background-color:#dddddd;">
                <Items>
                    <ext:Label ID="DescriptionLabel" runat="server" Cls="labelHeader" Text="<%$ Resources:WebResources|LicenseConfiguration.FormLabels, DescriptionLabelTitle %>">
                    </ext:Label>
                    <ext:Label runat="server" Html="<br /><br />" />
                    <ext:Label ID="Label1" runat="server" Text="<%$ Resources:WebResources|LicenseConfiguration.FormLabels, DescriptionLabelText %>">
                    </ext:Label>
                </Items>
            </ext:Panel>
            <ext:Panel runat="server" Title="<%$ Resources:WebResources|LicenseConfiguration.FormLabels, LicenseKeyTitle %>"
                Cls="licenseKeyPanel" BodyStyle="padding:10px 10px 10px 45px;font-weight:bold;">
                <Items>
                    <ext:Label ID="LicenseLabel" runat="server" Text="00000-00000-00000-00000-00000" IDMode="Explicit">
                    </ext:Label>
                </Items>
            </ext:Panel>
            
            </ext:Panel>
    partial view action. As you can see I set the containerID of the partialview to the viewport. But that fails and throws an exception.
     
     public ActionResult LicenseAdministration()
            {
                Ext.Net.MVC.PartialViewResult partialViewResult = new Ext.Net.MVC.PartialViewResult();
                partialViewResult.RenderMode = RenderMode.RenderTo;
                partialViewResult.ContainerId = "ViewPort1";
                partialViewResult.SingleControl = true;
                return partialViewResult;
            }
    Master page

    <ext:ViewPort ID="ViewPort1" runat="server" Layout="border" MonitorResize="true" IDMode="Explicit">         
            <Items>          
                      
                  <ext:Panel ID="westPanel"              
                        runat="server"                
                        Title="Navigator"                  
                        Region="West" 
                        Collapsible="true"
                        Layout="FitLayout" 
                        Margins="0 0 3 3" 
                        Collapsed="False"
                        Split="true" ButtonAlign="Left"  MonitorResize="True" MinWidth="200">
                        <Listeners> 
                            <Render Handler="Ext.net.DirectMethod.request({url: '/UserSettingArea/UserSetting/GetNavigationMenu', cleanRequest: true });" />  
                            <BodyResize Handler="WestPanelResized(item,width,height)" /> 
                        </Listeners>               
                       </ext:Panel>        
                 
                <ext:TabPanel 
                    ID="tpMain" 
                    runat="server" 
                    Region="Center" 
                    Margins="0 0 4 0" 
                    EnableTabScroll="true" TabWidth="10px" TabPosition="Top">
                    <Items>
                        <ext:Panel 
                            ID="Tab1" 
                            layout="Fit"
                            runat="server" 
                            Title="<%$ Resources:WebResources|Home.FormLabels, Home %>"
                            Icon="ApplicationForm" 
                            Border="false"> 
                           <AutoLoad    
                                AutoDataBind="true"
                                Url='/Home/HomePanelPartial'                                            
                                ShowMask="true" 
                                MaskMsg="Loading Panel..."                          
                                MonitorComplete="False" NoCache="True"
                                callback="ItemsRenderedPartial(response);" >                             
                                 </AutoLoad>                           
                            </ext:Panel>         
                    </Items>
                    <ToolTips>
                         <ext:ToolTip ID="ToolTip1"  runat="server" Delegate="#tpMain__Tab1" Html="Home" /> 
                    </ToolTips>               
                </ext:TabPanel>       
            </Items>       
        </ext:ViewPort>
    </body>
    </html>
    Last edited by Daniil; May 19, 2011 at 5:45 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I can't see where LicenseAdministration controller action is used. Is it the controller action to render a Window?

    Well, I guess we need full (but simplified) code to reproduce the issue.

    Please remove unnecessary code which is not required to reproduce the issue.

    Here is the guide how to get a minimized sample code:
    http://forums.ext.net/showthread.php?13672&viewfull=1#post56687
  3. #3
    of course there is a javascript method that calls the LicenseAdministration controller action as shown below. I was expecting you to know trhat to avoid be pasting too many code code here. The controller action LicenseAdministration renders the window

    This is the javascript code

    var buttonClick=function()
    {
     Ext.net.DirectEvent.request({
                            url:"/LicenseConfiguration/LicenseConfiguration/LicenseAdministration",
                            type: "load",
                            cleanRequest: true                        
                        }); 
    }
    This code is called on button click of a button on the IFRAMED page rendered in the tab.



    The licenceAdministration Window is LicenseAdministration.ascx


    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <ext:Window ID="winLicenseAdmin" runat="server" Title="<%$ Resources:WebResources|LicenseConfiguration.FormLabels, LicenseAdministrationTitle %>"
        Resizable="false" Modal="true" Height="580" Width="800" Border="False" Hidden="false" IDMode="Explicit">
        <Items>
            <ext:Panel runat="server" Cls="topPanel" Height="85" BodyStyle="padding:15px 10px 15px 10px;background-color:#dddddd;">
                <Items>
                    <ext:Label ID="DescriptionLabel" runat="server" Cls="labelHeader" Text="<%$ Resources:WebResources|LicenseConfiguration.FormLabels, DescriptionLabelTitle %>">
                    </ext:Label>
                    <ext:Label runat="server" Html="<br /><br />" />
                    <ext:Label runat="server" Text="<%$ Resources:WebResources|LicenseConfiguration.FormLabels, DescriptionLabelText %>">
                    </ext:Label>
                </Items>
            </ext:Panel>
            <ext:Panel runat="server" Title="<%$ Resources:WebResources|LicenseConfiguration.FormLabels, LicenseKeyTitle %>"
                Cls="licenseKeyPanel" BodyStyle="padding:10px 10px 10px 45px;font-weight:bold;">
                <Items>
                    <ext:Label ID="LicenseLabel" runat="server" Text="00000-00000-00000-00000-00000" IDMode="Explicit">
                    </ext:Label>
                </Items>
            </ext:Panel>
        </Items>
        
    </ext:Window>
    The action that shows the above window is
     public ActionResult LicenseAdministration()
            {
                Ext.Net.MVC.PartialViewResult partialViewResult = new Ext.Net.MVC.PartialViewResult();
                partialViewResult.RenderMode = RenderMode.RenderTo;
                partialViewResult.ContainerId = "ViewPort1"; 
                partialViewResult.SingleControl = true;
                return partialViewResult;
            }

    I have already pasted the masterpage with the viewport id Viewport1. The intent is to make the rendering of the window Modal across the viewPort and not just modal accross the Tab area.

    I believe the discription is self explanatory. Let me know if you need more clarification.

    [regard
  4. #4
    Now I understand, thank you.

    Well, there is no way to make a created in iframe window modal on a parent as well.

    The single solution is creating that window in a parent page. But I'm not sure how it can be achieved, and it's possible or not in context of PartialViewResult. I guess it's impossible.

    You could try to create an Ext.Net.Window instance, call .ToConfig() and pass that json object to a parent's function to create a window.
  5. #5
    I was able to achieve it by moving the call to the javascript loaded within the masterpage. But the problems now is that I cannot access the ext Components on the IFRAME because the Modal Window is rendered with the master page.

    How can I access for example an Ext grid component with ID="Mygrid" with IDMODE=explicit rendered in IFRAME from the parent page?

    regards
  6. #6
    It's the most appropriate solution.

    Here is the pattern to access IFrame components from a parent's page.
    ContainerWithIFrameClientId.getBody().ComponentClienId
  7. #7
    thanks. It worked

Similar Threads

  1. Replies: 5
    Last Post: Apr 20, 2012, 6:20 AM
  2. [CLOSED] Partial View Error
    By peter.campbell in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 10, 2012, 10:32 AM
  3. [CLOSED] Partial View & FormPanel Submit
    By peter.campbell in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 14, 2011, 12:01 PM
  4. [CLOSED] RegisterOnReadyScript in MVC partial view
    By SandorD in forum 1.x Legacy Premium Help
    Replies: 22
    Last Post: Aug 10, 2011, 4:17 PM
  5. [CLOSED] MVC- How to display a Partial View from a window
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 08, 2011, 11:32 AM

Posting Permissions