[CLOSED] DirectMethods.Request+webservice

  1. #1

    [CLOSED] DirectMethods.Request+webservice

    How i can increase the timeout of webmethod call using DirectMethods.Request.

    My code:
    Ext.net.DirectMethod.request({
                        url: '<%= ConfigurationManager.AppSettings["UtilitiesServiceURL"] %>' + 'GetTinyUrl',
                        cleanRequest: true,
                        json: true,
                        params: {
                            url: SourceLink
                        },
                        success: function (result) {
                        
                            Ext.getCmp('<%= pnlImagePreview.ClientID %>').hide();
                            Ext.getCmp('<%= txtPost.ClientID %>').hide();
                            Ext.getCmp('<%= txtComment.ClientID %>').show();
                            Ext.getCmp('<%= pnlLinkPreview.ClientID %>').show();
                            Ext.getCmp('<%= txtComment.ClientID %>').setValue('');
                            link = result.TinyURL;
                            Ext.getCmp('<%= lblLinkPreview.ClientID %>').setText(result.TinyURL);
                            Ext.getCmp('<%= txtTitle.ClientID %>').setValue(result.Title);
                            Ext.getCmp('<%= lblTitle.ClientID %>').setText(result.Title);
                            if(result.Description!=null)
                            {
                             Ext.getCmp('<%= lblDescription.ClientID %>').setText(result.Description);
                            }
                            else
                            {
                              Ext.getCmp('<%= lblDescription.ClientID %>').setText('');
                            }
                            
                            SetPreviewImage('');
                            OtherImageURLs = result.OtherImageURLs;
                            if (result.ImageURL) {
                           
                                SetPreviewImage(result.ImageURL);
                                selectedImage = result.ImageURL;
                                Ext.getCmp('<%= btnPrevious.ClientID %>').hide();
                                Ext.getCmp('<%= btnNext.ClientID %>').hide();
                                Ext.getCmp('<%= lblImageNumber.ClientID %>').hide();
                            }
                            else {
                           
                                if (OtherImageURLs && OtherImageURLs.length != 0) {
                               
                                    CurrentImageIndex = 0;
                                    SetPreviewImage(result.OtherImageURLs[0]);
                                    SetImagesNumber();
                                    Ext.getCmp('<%= btnPrevious.ClientID %>').show();
                                    Ext.getCmp('<%= btnNext.ClientID %>').show();
                                    Ext.getCmp('<%= lblImageNumber.ClientID %>').show();
                                    Ext.getCmp('<%= btnPrevious.ClientID %>').disable();
                                    if (OtherImageURLs.length <= 1) {
                                        Ext.getCmp('<%= btnNext.ClientID %>').disable();
                                    }
                                }
                                else {
                               
                                    Ext.getCmp('<%= btnPrevious.ClientID %>').hide();
                                    Ext.getCmp('<%= btnNext.ClientID %>').hide();
                                    Ext.getCmp('<%= pnlImagePreview.ClientID %>').hide();
                                    Ext.getCmp('<%= pnlLinkPreview.ClientID %>').getEl().unmask();
                                    Ext.getCmp('<%= lblImageNumber.ClientID %>').hide();
                                }
                            }
                            Ext.getCmp('<%= pnlPost.ClientID %>').getEl().unmask();
                        },
                        failure: function (errorMsg) {
                        alert(errorMsg);
                            ShowMessage(ErrorMessageText, ErrorMessageTitle, messageMode.error);
                            Ext.getCmp('<%= pnlPost.ClientID %>').getEl().unmask();
                        }
                    });
    Last edited by Daniil; May 17, 2011 at 1:49 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please set up
    timeout : 50000
    for DirectMethod's config object.
  3. #3
    Hi,

    You should not require all those calls to Ext.getCmp. Just referencing the component by its .ClientID should work perfectly fine.

    Example

    // Old
    Ext.getCmp('<%= pnlImagePreview.ClientID %>').hide();
    
    // New
    <%= pnlImagePreview.ClientID %>.hide();
    Hope this helps.
    Geoffrey McGill
    Founder & CEO

Similar Threads

  1. Replies: 7
    Last Post: Nov 29, 2011, 7:07 AM
  2. [CLOSED] [1.2] Force request from WebService-ComboBox
    By FVNoel in forum 1.x Premium Help
    Replies: 1
    Last Post: Nov 22, 2011, 12:35 PM
  3. Replies: 11
    Last Post: May 23, 2011, 1:33 PM
  4. Replies: 10
    Last Post: Apr 30, 2010, 5:42 PM
  5. [CLOSED] How to get Jason request from WebService
    By acrossdev in forum 1.x Premium Help
    Replies: 3
    Last Post: May 22, 2009, 9:59 AM

Posting Permissions