[CLOSED] Inherit KeyMap

  1. #1

    [CLOSED] Inherit KeyMap



    Hi Im using key map on my main page. there I have a tabpanel that shows other (local) pages in iframes in each tab. Is it possible when in this tab in the ifram to be able to use the key map specified on the main page.
    Here is a simple example of what my page looks like


    <%@ Page Language="C#" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    
    <script runat="server">
    
    
        protected void Page_Load(object sender, EventArgs e)
        {
            tabpnlMain.ActiveTab.AutoLoad.Url = "http://www.google.se";
            tabpnlMain.AutoLoad.Mode = LoadMode.IFrame;
            tabpnlMain.ActiveTab.Load();     
    
    
        }
    
    
     
    
    
    
    </script>
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
    
    
    <script type="text/javascript">
    
    
    
    </script>
    
    
    <title>Example</title>
    
    
       
    
    
    </head>
    <body style="padding:10px;">
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager1" Theme="Slate" runat="server" StateProvider="PostBack" />
    
    
    
    <ext:TabPanel ID="tabpnlMain" runat="server" Border="true" Height="400"  >
        <Tabs>
            <ext:Tab  ID="tab1" runat="server" Title="Tab 1"  >
            </ext:Tab>
        </Tabs>
    </ext:TabPanel>
    
    
    
    <ext:KeyMap ID="KeyMap1" runat="server"  Target="={Ext.isGecko ? document : Ext.getBody()}" >
    <ext:KeyBinding Alt="true" StopEvent="true" >
        <Keys>
            <ext:Key Code="W" />
        </Keys>
        <Listeners>
            <Event Handler="Ext.Msg.alert('test','test');" />
        </Listeners >           
    </ext:KeyBinding>
    </ext:KeyMap>
    </form>
    </body>
    </html>
    /Mikael
  2. #2

    RE: [CLOSED] Inherit KeyMap



    Hi
    I know that my question maybe was a bit fuzzy. But what im after is that I dont want to copy the same keymap to all my iframe pages in my tabpanel, then it will be alot of work if I need to change something in the keymap. Is there a way of making one keymap to work in in several files? Maybe like a include or something?

    /Mikael
  3. #3

    RE: [CLOSED] Inherit KeyMap

    Hi Mikael,

    It is impossible to use KeyMap for several pages/targets because key map can listen only one target.


    I can suggest create base page class which will be contain keymap.
    Then you can use that class as base for other pages which require key map


    Or you can create user control which will be contain key map. You can set target dynamically and place this user control to the pages.




  4. #4

    RE: [CLOSED] Inherit KeyMap

    Thanks! thats smart ill try that.

    /Mikael

Similar Threads

  1. [CLOSED] Inherit CommandColumn
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Mar 02, 2011, 2:36 PM
  2. [CLOSED] KeyMap and IE
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jan 06, 2011, 2:48 PM
  3. Inherit Coolite ScriptManager
    By kowi in forum 1.x Help
    Replies: 3
    Last Post: Nov 12, 2009, 5:56 PM
  4. Replies: 2
    Last Post: Oct 15, 2009, 12:12 PM

Posting Permissions