[CLOSED] Error pressing buttons hosted on a toolbar in overflow mode

  1. #1

    [CLOSED] Error pressing buttons hosted on a toolbar in overflow mode

    Hello,
    I get a strange error when the user clicks on a toolbar item located in the overflow menu. I recreate the issue this way:

    <%@ Page Title="Test" Language="c#" 
      EnableSessionState="ReadOnly" 
      Culture="auto" meta:resourcekey="PageResource1" %>
    
      <html>
      <head></head>
      <body>
      <ext:ResourceManager runat="server" /> 
      <ext:Window runat="server" Height="300" Width="300">
        <TopBar>
            <ext:Toolbar runat="server" ClassicButtonStyle="True"
                Padding="5" EnableOverflow="True">
                <Items>
                  <ext:Button runat="server" Text="LONG LONG LONG LONG LONG LONG LONG Command" OnDirectClick="OnToggle">
                  </ext:Button>
                  <ext:Button runat="server" Icon="PageWhite" EnableToggle="True" OnDirectClick="OnToggle">
                  </ext:Button>
                  </Items>
            </ext:Toolbar>
        </TopBar>
      </ext:Window>
      <script runat="server">
      protected void OnToggle(object sender, Ext.Net.DirectEventArgs arg) {
      }
      </script>
      </body>
      </html>
    if you go to overflow menu of the toolbar and whatever button I click, I get a message like:

    The control with ID 'menuitem-1033' not found
    Last edited by Daniil; Feb 27, 2014 at 11:22 AM. Reason: [CLOSED]
  2. #2
    Hi @sbg,

    Yes, there is a problem with such a scenario. The Toolbar overflow functionality creates a menu item for the Button if there is an overflow. A click event occurs for that menu item, not for the Button itself. And the DirectEvent cannot "understand" it.

    We already have an Issue for similar problems.
    https://github.com/extnet/Ext.NET/issues/21

    Though, it is hard to fix all the cases in a generic way.

    So, please use a Button's Handler + DirectMethod instead of DirectEvent.
    <ext:Button runat="server" Handler="App.direct.ButtonClick();" />
  3. #3
    Thank you, Daniil, it works.

    Regards,
    SBG


    Quote Originally Posted by Daniil View Post
    Hi @sbg,

    So, please use a Button's Handler + DirectMethod instead of DirectEvent.
    <ext:Button runat="server" Handler="App.direct.ButtonClick();" />
  4. #4
    A Button's Click Listener works now in Ext.NET 3.

Similar Threads

  1. [CLOSED] Disable overflow for some ToolBar's items
    By RCN in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 30, 2013, 2:22 PM
  2. Display error of Toolbar Overflow
    By howardyin in forum 2.x Help
    Replies: 8
    Last Post: Jan 11, 2013, 1:04 AM
  3. Replies: 3
    Last Post: Nov 01, 2012, 11:31 AM
  4. [CLOSED] Toolbar overflow icons
    By paulc in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 28, 2011, 2:09 PM
  5. [CLOSED] [1.0] Toolbar Overflow
    By Ben in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 12, 2010, 3:02 PM

Tags for this Thread

Posting Permissions