[OPEN] [#343] Ext.Msg.prompt too small.

  1. #1

    [OPEN] [#343] Ext.Msg.prompt too small and DirectMethod failure with UserControlLoader

    I have the following:
            <Listeners>
                <Click Handler="Ext.Msg.prompt('Url', 'Please enter the url you wish to import.<br/><br/>Make sure this link is to a page you admin.',
                        function (btn, url) {
                            if(btn=='ok')
                                App.direct.DoImport(url);
                        },'window',false,'https://www.domain.com/');" />
            </Listeners>
    The problem is the input prompt is tiny and I'd like it to at least expand to the length of the window. How?
    Last edited by michaeld; Sep 11, 2013 at 11:45 PM. Reason: Expand Title
  2. #2
    While I'm here, I'm also getting an exception "Uncaught TypeError: Object #<Object> has no method 'DoImport'.

    Here's the code in the code-behind.
        [DirectMethod]
        public void DoImport( string url ) {
            // Do Work...
        }
    What am I missing?

    There is no namespace around my UserControl
    Last edited by michaeld; Sep 11, 2013 at 11:39 AM.
  3. #3
    Hi @michaeld,

    There is an open bug for that.
    http://www.sencha.com/forum/showthread.php?268825

    We created an Issue to track it.
    https://github.com/extnet/Ext.NET/issues/343

    As for a DirectMethod.

    Where is it defined? Page, user control?
  4. #4
    Quote Originally Posted by Daniil View Post
    There is an open bug for that.
    http://www.sencha.com/forum/showthread.php?268825

    We created an Issue to track it.
    https://github.com/extnet/Ext.NET/issues/343
    I've seen no work-around, yet there has to be a way to get access to the input field to change it after the fact? I've seen other solutions that do similar but for previous versions. Is there a way to access the created prompt window and set the input field manually?

    If your answer is create a true extjs window here or an extnet one that is hidden till I need to access it, okay, let me know.

    Quote Originally Posted by Daniil View Post
    As for a DirectMethod.

    Where is it defined? Page, user control?
    User control. The Direct Events in this same user control have no problem firing, just the Direct Method.
  5. #5
    Here are some more notes on the DirectMethod debugging.

    When I trap the exception in the client-side debugger and expand App.direct, I see the following:
      App.direct: Object
        ctl00_cp_EventUC: Object
          DoImport: function (url,config){return Ext.net.DirectMethod.request("DoImport",Ext.applyIf(config || {}, {params:{url:url},control:"ctl00_cp_EventUC",viewStateMode:"enabled"}));}
          __proto__: Object
        __proto__: Object
    I'm guessing the reason it cannot find the Direct Method is because it is under ctl00_cp_EventUC. EventUC is the name that I assign my UserControlID in UserControlLoader.

                var ctl = new UserControlLoader( new UserControlLoader.Config() { Path = ctlname } );
                ctl.UserControlID = "EventUC";
                ProfP.Items.Add( ctl );
    I'm suspecting this is another bug/issue related to UserControlLoader not resolving DirectMethod correctly to the right position so App.direct can resolve.

    This is what the builder is constructing...
    Ext.ns("App.direct");Ext.apply(App.direct, { ctl00_cp_EventUC:{DoImport:function(url,config){return Ext.net.DirectMethod.request("DoImport", ...
    Last edited by michaeld; Sep 11, 2013 at 11:42 PM.
  6. #6
    Quote Originally Posted by michaeld View Post
    I've seen no work-around, yet there has to be a way to get access to the input field to change it after the fact? I've seen other solutions that do similar but for previous versions. Is there a way to access the created prompt window and set the input field manually?
    It is possible by:
    Ext.Msg.textField.setWidth(300);
    As for DirectMethods in user controls.

    The namespace is constructed this way by default:
    App.direct.UserControlID.DirectMethodName
    To prune the user control's id part please use the DirectMethodProxyID attribute on a class level:
    https://examples2.ext.net/#/Events/D...thods/ID_Mode/
    [DirectMethodProxyID(IDMode = DirectMethodProxyIDMode.None)]
    public partial class MyUserControl: System.Web.UI.MasterPage
    Or on a method level:
    [DirectMethod(IDMode=DirectMethodProxyIDMode.None)]
    public void MyDirectMethod()
  7. #7
    Tried both. Both work. Thank you.

Similar Threads

  1. [CLOSED] i want to rotate small image
    By UT007 in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: May 06, 2013, 3:57 PM
  2. [CLOSED] HtmlEditor Small Size
    By stratadev in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 20, 2013, 8:00 AM
  3. [CLOSED] Small green row in the grids
    By xeo4.it in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 13, 2012, 1:53 PM
  4. Ext.Net+ASP WebForm Big project small DLL good??
    By Martin.Vecchione in forum Open Discussions
    Replies: 3
    Last Post: Apr 05, 2012, 3:40 PM
  5. [CLOSED] Localization small issue
    By methode in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 10, 2009, 4:20 AM

Posting Permissions