[CLOSED] How to make a window belonging to a desktop?

  1. #1

    [CLOSED] How to make a window belonging to a desktop?

    Hello

    As desktopWindow element has disapeared, I want to know how I can achive that:

    I have define an about window called from my start menu like that :

    <ext:DesktopModule ModuleID="About">
        <Launcher Text="About..." Icon="Information" />
        <Window>
            <ext:Window 
                runat="server" 
                Icon="Information"             
                Width="250"
                Height="200"
                Layout="Fit" 
                Hidden="True" 
                ExpandOnShow="True" 
                MinHeight="100" 
                MinWidth="100" 
                Maximizable="False" 
                Resizable="False" 
                Title="About" 
                Html="<br /><br /><center><b>ResMed KPIs global Version 2.0.0.0 Alpha 1</b></center><br /><br /><center><b><a href='javascript:#{wndNews}.show();'>What's new in this version</a></b></center><br /><br /><center>For query, information, help: <a href='mailto:bruno.teuile@resmed.fr'>contact</a></center>" 
                Minimizable="False" 
                Modal="True">                        
            </ext:Window>
        </Window>
    </ext:DesktopModule>
    In this window, I have a link that will open my changelog window define like that somewhere in the aspx page:

    <ext:Window 
        ID="wndNews" 
        runat="server" 
        Icon="Help"             
        Width="1000"
        Height="600"
        Layout="Fit" 
        Hidden="True" 
        ExpandOnShow="True" 
        MinHeight="100" 
        MinWidth="100" 
        Maximizable="False" 
        Minimizable="True"
        Resizable="False" 
        Title="What's new in this version" 
        Html="<embed id='DOC' src='documentation/NewVersion.pdf' width='980' height='600'>" 
        Modal="False">                        
    </ext:Window>
    Question : how can I connect this window to Desktop so I can see it in the taskbar and minimized it if needed?
    Last edited by Daniil; Apr 23, 2012 at 9:40 AM. Reason: [CLOSED]
  2. #2
    Hi,

    You should create a Window using the Desktop CreateWindow server method.
    this.Desktop1.CreateWindow(new Window()
    {
        Title = "Dynamic Window"
    });
    or client side
    App.Desktop1.desktop.showWindow({
        id     : "MyWindow1",
        title  : "Dynamic Window",
        width  : 200,
        height : 100
    });
  3. #3
    Wow! this is a big drawback from version 1.3, it was so easy to create a desktop window with DesktopWindow element...Helas, I was fear it was the only answer.

    If I undrstand well, all elements contained by the window must be create this way, this means, gridpanel, store for grid, top/bottom bar, and so on have to be created by code and not by using ext.net elements. Am I right.

    a module could be added only at first level menu?
  4. #4
    Please clarify what way do you attach that DesktopWindow to the Desktop in v1?
  5. #5
    I simply create

    <DesktoWindow  Id="toto">
    
    </DesktoWindow>
    and in the menu, on the click listener:

    #{toto}.show()
    More details taken from here https://examples1.ext.net/#/Desktop/Introduction/Overview/ :

                   <Items>
                        <ext:MenuItem ID="MenuItem1" runat="server" Text="All" Icon="Folder" HideOnClick="false">
                            <Menu>
                                <ext:Menu ID="Menu1" runat="server">
                                    <Items>
                                        <ext:MenuItem Text="Add Customer" Icon="Add">
                                            <Listeners>
                                                <Click Handler="#{winCustomer}.show();" />
                                            </Listeners>
                                        </ext:MenuItem>
                                        <ext:MenuItem Text="Company Info" Icon="Lorry">
                                            <Listeners>
                                                <Click Handler="#{winCompany}.show();" />
                                            </Listeners>
                                        </ext:MenuItem>
                                        <ext:MenuItem Text="Web Browser" Icon="World">
                                            <Listeners>
                                                <Click Handler="#{winBrowser}.show();" />
                                            </Listeners>
                                        </ext:MenuItem>
                                        <ext:MenuItem Text="Create dynamic" Icon="World">
                                            <Listeners>
                                                <Click Handler="createDynamicWindow(#{MyDesktop});" />
                                            </Listeners>
                                        </ext:MenuItem>
                                    </Items>
                                </ext:Menu>
                            </Menu>
                        </ext:MenuItem>
                        <ext:MenuSeparator />
                    </Items>
            <ext:DesktopWindow 
                ID="winCompany" 
                runat="server" 
                InitCenter="false"
                Title="Company Info" 
                Icon="Lorry"             
                Width="550"
                Height="320"
                PageX="200" 
                PageY="125"
                Layout="Fit">
                <TopBar>
                    <ext:Toolbar ID="ToolBar1" runat="server">
                        <Items>
                            <ext:Button ID="btnSave" runat="server" Text="Save" Icon="Disk">
                                <Listeners>
                                    <Click Handler="#{GridPanel1}.save();" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="btnLoad" runat="server" Text="Reload" Icon="ArrowRefresh">
                                <Listeners>
                                    <Click Handler="#{GridPanel1}.load();" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="extbtnedit" runat="server" Icon="Add">
                                <ToolTips>
                                    <ext:ToolTip ID="ToolTip2" Title="Edit Entry" runat="server" Html="Edit" />
                                </ToolTips>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>           
                <Items>
                    <ext:GridPanel 
                        ID="GridPanel1" 
                        runat="server" 
                        StoreID="Store1" 
                        StripeRows="true"
                        Border="false"
                        AutoExpandColumn="Company">
                        <ColumnModel runat="server">
                            <Columns>
                                <ext:Column ColumnID="Company" Header="Company" Width="160" DataIndex="company" />
                                <ext:Column Header="Price" Width="75" DataIndex="price">
                                    <Renderer Format="UsMoney" />
                                </ext:Column>
                                <ext:Column Header="Change" Width="75" DataIndex="change">
                                    <Renderer Fn="change" />
                                </ext:Column>
                                <ext:Column Header="Change" Width="75" DataIndex="pctChange">
                                    <Renderer Fn="pctChange" />
                                </ext:Column>
                            </Columns>
                        </ColumnModel>
                        <SelectionModel>
                            <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
                        </SelectionModel>
                        <LoadMask ShowMask="true" />
                        <BottomBar>
                            <ext:PagingToolbar ID="PagingToolBar2" runat="server" PageSize="10" StoreID="Store1" />
                        </BottomBar>
                    </ext:GridPanel>
                </Items>
            </ext:DesktopWindow>
  6. #6
    Honestly, I was surprised that it works in v1.

    In v2 you can set up a DesktopModule and open its Window from anywhere.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
    
        <ext:Desktop ID="Desktop1" runat="server" BackgroundColor="black">
            <Modules>
                <ext:DesktopModule ModuleID="Module1">
                    <Window>
                        <ext:Window runat="server" Title="Greeting" Html="Hello!" />
                    </Window>
                </ext:DesktopModule>
            </Modules>
            <StartMenu runat="server" Height="300">
                <MenuItems>
                    <ext:MenuItem runat="server" Text="Open Window">
                        <Listeners>
                            <Click Handler="#{Desktop1}.getModule('Module1').createWindow();" />
                        </Listeners>
                    </ext:MenuItem>
                </MenuItems>
            </StartMenu>
        </ext:Desktop>
    </body>
    </html>
  7. #7
    Perfecto, I think it will make the work. By the way, for v1, it id your own desktop example.
  8. #8
    Quote Originally Posted by feanor91 View Post
    By the way, for v1, it id your own desktop example.
    Well, yes. But I thought you wanted to avoid defining Modules for these windows. Never mind.

Similar Threads

  1. Replies: 8
    Last Post: Apr 30, 2012, 1:51 PM
  2. [CLOSED] Minimize window created in another desktop window
    By CarWise in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 03, 2011, 1:46 PM
  3. Refreshing desktop control from desktop window
    By AnilVelamuri in forum 1.x Help
    Replies: 0
    Last Post: May 26, 2010, 7:53 AM
  4. Replies: 3
    Last Post: Feb 03, 2009, 5:57 PM
  5. [CLOSED] How can I make my own Window?
    By bruce in forum 1.x Help
    Replies: 2
    Last Post: Oct 24, 2008, 11:52 PM

Posting Permissions