The official release of Ext.NET Mobile is now available. Ext.NET Mobile is an ASP.NET component framework for building Phone and Tablet specific mobile web applications. Read More

Problem on raising DirectEvent on DesktopModuleProxy Window parameter

  1. #1

    Problem on raising DirectEvent on DesktopModuleProxy Window parameter

    Hi there!
    There is a problem on raising DirectEvent on DesktopModuleProxy Window prioperty. When I set a window in Window tag of DesktopModuleProxy and setting a SplitButton (inserted in Items of a toolbar object) DirectEvent (Click event) to execute, ResourceManager could not found SplitButton object that is embedded in my Toolbar object of my window. It will return "The control with ID 'ButtonHelp' not found" error. How can I solve it? I changed IDMode of my SplitButton object to anything but nothing changed!!!

    My control code is

    <ext:SplitButton ID="ButtonHelp" Text="Help" runat="server" Icon="Help" ToolTip="Show help of current view." Scale="Large" RowSpan="3" IconAlign="Top" ArrowAlign="Right">
    <Menu>
        <ext:Menu runat="server" ID="HelpMenu">
            <Items>
                <ext:MenuItem ID="MenuItemAboutDiten" runat="server" Text="About DITeN framework" Icon="Information" ToolTip="Show information about DITeN.">
                    <DirectEvents>
                        <Click OnEvent="MenuItemAboutDiten_Click"></Click>
                    </DirectEvents>
                </ext:MenuItem>
            </Items>
        </ext:Menu>
    </Menu>
    <DirectEvents>
        <Click OnEvent="ButtonHelp_Click">
            <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="ContentPanel" Msg="Show help" />
            <ExtraParams>
                <ext:Parameter Name="HelpID" Value="Diten.Web.UI.WebControls.SystemControls.Explorer" Mode="Value" />
            </ExtraParams>
        </Click>
    </DirectEvents>
    </ext:SplitButton>
    My code behind is

    protected void ButtonHelp_Click(object sender, DirectEventArgs e)
    {
        HelpWindow.HelpId = e.ExtraParams["HelpId"];
        HelpWindow.Show();
    }
    And finally, why when I use KeyMap object in content tag of my ButtonGroup object, the Window object of DesktopModuleProxy will not be appeared in my Desktop control?!?

    My code is

    <ext:ButtonGroup ID="ButtonGroupSelect" runat="server" Title="Select" Columns="1">
        <Content>
        <ext:KeyMap runat="server" Target="#{ContentPanel}">
                <Binding>
                    <ext:KeyBinding Ctrl="True" Handler="#{StatsButtonSelectAll}.fireEvent('click');">
                        <Keys>
                            <ext:Key Code="A" />
                        </Keys>
                    </ext:KeyBinding>
                </Binding>
            </ext:KeyMap>
        </Content>
        <Items>
            <ext:Button ID="StatsButtonSelectAll" runat="server" Text="Select all" ToolTip="Select all items in this view. (Ctrl+A)" OnDirectClick="ButtonSelectAll_Click" />
            <ext:Button ID="StatsButtonSelectNone" runat="server" Text="Select none" ToolTip="Clear all your selections." OnDirectClick="ButtonSelectNone_Click" />
            <ext:Button ID="StatsButtonInvertSelection" runat="server" Text="Invert selection" ToolTip="Reverse the CURRENT SELECTION." OnDirectClick="ButtonInvertSelection_Click" />
        </Items>
    </ext:ButtonGroup>
    Click image for larger version. 

Name:	2017-10-31 (1).jpg 
Views:	2 
Size:	97.1 KB 
ID:	25069
    Last edited by ArashRahimian; Nov 03, 2017 at 6:26 AM.
  2. #2

    Base of problem

    In previous version of Ext.Net I used Desktop.Module.Add method and it was working fine but in this version (4.5) this method is not working for adding modules to desktop control.
    Last edited by ArashRahimian; Nov 14, 2017 at 12:54 PM.
  3. #3

    Source of the problem

    Hi
    I think base of the problem is ResourceManager. It can not find objects that has DirecEvents like Click. When I put a simple button in WhatsNew.ascx control of Desktop control sample of Ext.Net and set Click DirectEvent this error will be raised after click on button.

    Click image for larger version. 

Name:	2017-11-14.jpg 
Views:	1 
Size:	104.7 KB 
ID:	25075

    I think (maybe) in this part of code of ResourceManage.RaisePostBackEvent, Page is null.
    if (!flag1)
    {
        if (configID == "-")
        {
            ctrl = !flag2 ? (Control)this : (Control)this.Page;
        }
        else
        {
            ctrl = Ext.Net.ResourceManager.FindControlByConfigID((Control)this.Page, configID, true, (Control)null);
            if (ctrl == null)
    throw new HttpException("The control with ID '{0}' not found".FormatWith((object)configID));
        }
    }
    Attached Thumbnails Ext.Net.0001.jpg  
    Last edited by ArashRahimian; Nov 14, 2017 at 1:07 PM.
  4. #4

    After some experiment

    Hi
    When I use this tag for registering mi control every thing is fine.

    <%@ Register Src="modules/WhatsNew.ascx" TagPrefix="mod" TagName="WhatsNew" %>
    But when I use this method for registering my control dynamically this error will be raised on my WhatsNew.ascx test button click direct event.

    var appHolder = LoadControl("~/modules/WhatsNew.ascx");
    
    var desktopModuleProxy = ControlUtils.FindControl<DesktopModuleProxy>(appHolder);
    
    if (desktopModuleProxy != null)
    {
        desktopModuleProxy.RegisterModule();
    }
    Last edited by ArashRahimian; Nov 15, 2017 at 7:21 AM.

Similar Threads

  1. Replies: 3
    Last Post: Sep 26, 2013, 3:36 PM
  2. Replies: 0
    Last Post: May 26, 2013, 4:17 PM
  3. Problem in raising direct methods in usercontrol
    By lavanya.influx@gmail.com in forum 2.x Help
    Replies: 5
    Last Post: Nov 16, 2012, 12:31 AM
  4. MVC Razor PartialViews with DesktopModuleProxy
    By markusn in forum 2.x Help
    Replies: 1
    Last Post: Nov 04, 2012, 4:27 PM
  5. [CLOSED] DateTime parameter on DirectEvent
    By Stefanaccio in forum 1.x Premium Help
    Replies: 2
    Last Post: Sep 17, 2010, 5:12 PM

Posting Permissions