[CLOSED] Problem resetting a ComboBox in Frame mode

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Problem resetting a ComboBox in Frame mode

    Hi,

    I believe I was able to reproduce in v2.x the combo resetting issue originally discovered in v1.x. http://forums.ext.net/showthread.php...l=1#post109514. Please refer to the code sample below. The good news is that the override that Daniil had provided at the time is still functional in v2.x :)

    Ext.override(Ext.form.ComboBox, {
        reset: function () {
            if (this.hasFocus) {
                this.triggerBlur();
                this.blur();
            }
    
            if (this.clearFilterOnReset && this.mode == 'local') {
                this.store.clearFilter();
            }
    
            Ext.form.ComboBox.superclass.reset.call(this);
        }
    });
    WindowComboMain.aspx

    <%@ 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 id="Head1" runat="server">
        <title>Ext.Net 2.x</title>
        <ext:ResourcePlaceHolder ID="ResourcePlaceHolder1" runat="server" Mode="Script" />
        <ext:ResourcePlaceHolder ID="ResourcePlaceHolder2" runat="server" Mode="Style" />
        <script type="text/javascript">
            var showWindow = function () {
                var wnd = App.Window1;
                if (wnd.getBody() && wnd.getBody().App) {
                    wnd.getBody().App.ComboBox1.reset();
                }
                wnd.center();
                wnd.setVisible(true);
            };
    
        </script>
    </head>
    <body>
        <form id="Form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server">
        </ext:ResourceManager>
        <ext:Viewport runat="server" Layout="FitLayout">
            <Items>
                <ext:Panel runat="server">
                    <BottomBar>
                        <ext:Toolbar runat="server">
                            <Items>
                                <ext:Button ID="Button1" runat="server" Text="Show Window">
                                    <Listeners>
                                        <Click Handler="showWindow();">
                                        </Click>
                                    </Listeners>
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </BottomBar>
                </ext:Panel>
            </Items>
        </ext:Viewport>
        <ext:Window ID="Window1" runat="server" Icon="CogEdit" Title="Edit" Width="800" Height="600" Padding="15"
            Resizable="false" Collapsible="false" Hidden="true" Modal="true" Draggable="true">
            <Loader runat="server" AutoLoad="true" Mode="Frame" Url="WindowComboFrame.aspx"></Loader>
        </ext:Window>
        </form>
    </body>
    </html>

    WindowComboFrame.aspx

    <%@ 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 id="Head1" runat="server">
        <title>Ext.Net 2.x</title>
        <ext:ResourcePlaceHolder ID="ResourcePlaceHolder1" runat="server" Mode="Script" />
        <ext:ResourcePlaceHolder ID="ResourcePlaceHolder2" runat="server" Mode="Style" />
    </head>
    <body>
        <form id="Form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server">
        </ext:ResourceManager>
        <ext:Viewport runat="server" Layout="FitLayout">
            <Items>
                <ext:Panel runat="server">
                    <Items>
                        <ext:ComboBox ID="ComboBox1" runat="server" FieldLabel="Select an item" EmptyText="Select an item...">
                            <Items>
                                <ext:ListItem Text="Item 1" Value="1">
                                </ext:ListItem>
                                <ext:ListItem Text="Item 2" Value="2">
                                </ext:ListItem>
                                <ext:ListItem Text="Item 3" Value="3">
                                </ext:ListItem>
                            </Items>
                        </ext:ComboBox>
                    </Items>
                </ext:Panel>
            </Items>
        </ext:Viewport>
        </form>
    </body>
    </html>
    Last edited by Daniil; Aug 01, 2013 at 8:16 AM. Reason: [CLOSED]
  2. #2
    Hello!

    I couldn't reproduce this issue with our trunk. Can you say what browser do you use and is this issue reproducible with our trunk.
  3. #3
    Quote Originally Posted by Baidaly View Post
    Hello!

    I couldn't reproduce this issue with our trunk. Can you say what browser do you use and is this issue reproducible with our trunk.
    IE 9. The code is obtained from the trunk.
  4. #4
    Thank you! I was able to reproduce.

    We will investigate it.
  5. #5
    Hi,

    A ComboBox appears to be reset, just its list is not collapsed. Can you confirm these statements?
  6. #6
    Confirmed. Consequently, the EmptyText string doesn't get displayed in that scenario as well.
  7. #7
    I am asking, because I am not sure it should be considered as a bug. I mean the API stuff, should the reset method collapse a ComboBox?

    Just I think how to formulate a report to Sencha. Maybe, something like "Probably, it might be not considered as a bug, but the scenario is quite real. So, it would be nice to have a resolution on the ExtJS level without a necessity to override something". What do you think? Would you personally persist it is a bug?
  8. #8
    I wouldn't call it critical but it's a bug in my mind. As it stands, there's a distinct difference in behavior of the controls hosted by a framed as opposed to a non-framed window. After a popup window is removed from the view, the end user should expect it to lose the focus completely with all the housed controls blurred and/or collapsed to their initial state unless instructed otherwise by the developer. Obviously, being a "windowed" control, the ComboBox adds another wrinkle to the experience so it would be nice to make it consistent across the board.
    With that being said, I don't insist on your reporting this to Sencha as a bug. I'm happy with your override as long as it keeps working :)
  9. #9
    I wouldn't consider this issue as a bug as well because it's a browser behavior and I don't think it should be included in Sencha's or our code.

    For now, we are going to close this thread but if you'll have any concerns feel free to write.
    Last edited by Daniil; Jul 18, 2013 at 3:18 AM. Reason: but => bug
  10. #10
    Otherwise, some developer can expect that a ComboBox stays focused inside an iframe even its parent Window gets hidden.

    Finally, I came up with something to ask Sencha in a "bug report" format.
    http://www.sencha.com/forum/showthread.php?268109

    Daulet, do you mind I re-open the thread?
Page 1 of 2 12 LastLast

Similar Threads

  1. Problem resetting a form
    By vadym.f in forum 1.x Help
    Replies: 15
    Last Post: Nov 26, 2014, 1:47 PM
  2. [CLOSED] Problem resetting a form
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: May 21, 2013, 3:36 AM
  3. Replies: 4
    Last Post: Oct 03, 2012, 12:50 PM
  4. Replies: 5
    Last Post: May 18, 2012, 1:41 PM
  5. problem after resetting form controls populated
    By Ewerton93 in forum 1.x Help
    Replies: 1
    Last Post: Apr 25, 2012, 3:48 PM

Tags for this Thread

Posting Permissions