Is there some workaround for the IFrame focus problem?

  1. #1

    Is there some workaround for the IFrame focus problem?

    I wasn't quite sure how to word the subject correctly, but what I'm referring to is the fact that when using IFrames, context menus from other frames do not disappear. You have already confirmed this to be an issue and will work on it in a future release. However, until then, I REALLY need a workaround as it is very bad and may be a showstopper for us since we make heavy use of IFrame (Panel AutoLoad, etc) and have lots of context menus throughout the app. It just looks very bad and is frankly quite confusing to the end user to have menus remain open, even when clicking out of that frame.

    I don't mind if the work around is ugly, I just need something. Can't I add some JavaScript to my various panels to make sure that any other context menu is properly closed? Please let me know. Thanks.
  2. #2

    RE: Is there some workaround for the IFrame focus problem?

    Hi,

    There is one workaround. But it works if iframe page is located in one domain with main page (otherwise you will get access is denied exception under IE)

    Please see the following sample
    
    <%@ 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">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title></title>
        
        <script type="text/javascript">
           function onMouseDown(e){
               if(!e.getTarget(".x-menu")){
                   Ext.menu.MenuMgr.hideAll();
               }
           }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
        
            <ext:Panel runat="server" Title="Panel" Width="600" Height="600">
                <TopBar>
                    <ext:Toolbar runat="server">
                        <Items>
                            <ext:ToolbarSplitButton runat="server" Text="SplitButton">
                                <Menu>
                                    <ext:Menu runat="server">
                                        <Items>
                                            <ext:MenuItem runat="server" Text="Item1"></ext:MenuItem>
                                            <ext:MenuItem runat="server" Text="Item2"></ext:MenuItem>
                                            <ext:MenuItem runat="server" Text="Item3"></ext:MenuItem>
                                            <ext:MenuItem runat="server" Text="Item4"></ext:MenuItem>
                                            <ext:MenuItem runat="server" Text="Item5"></ext:MenuItem>
                                        </Items>
                                    </ext:Menu>
                                </Menu>
                            </ext:ToolbarSplitButton>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                
                <AutoLoad Url="AjaxPage.aspx" Mode="IFrame" ShowMask="true"/>
                
                <Listeners>
                    <Update Handler="Ext.fly(this.iframe.dom.contentWindow.document).on('mousedown', onMouseDown)" />
                </Listeners>
            </ext:Panel>
        </form>
    </body>
    </html>
  3. #3

    RE: Is there some workaround for the IFrame focus problem?

    All in the same domain.. I will take a look and let you know. Thanks.

Similar Threads

  1. IFrame: Gridpanel focus
    By mrd in forum 2.x Help
    Replies: 1
    Last Post: Dec 05, 2012, 3:49 AM
  2. EditableGrid focus Problem?
    By zyyjc in forum 1.x Help
    Replies: 0
    Last Post: May 25, 2012, 1:00 PM
  3. Still no workaround for Opera context menu "bug"?
    By juanpablo.belli@huddle.com.ar in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 04, 2009, 11:25 PM
  4. [CLOSED] focus problem
    By peterdiplaros in forum 1.x Legacy Premium Help
    Replies: 19
    Last Post: Feb 05, 2009, 6:20 PM
  5. Replies: 3
    Last Post: Dec 27, 2008, 6:04 AM

Posting Permissions