JScript Error: Coolite.AjaxMethods is null or not an object

  1. #1

    JScript Error: Coolite.AjaxMethods is null or not an object



    Hi,

    I try to add Tabs into TabPanel programmatically and bind activate event of tab to the server method in JavaScript code. The server side AjaxMethod must update East region with document information.

    
    *   <script type="text/javascript">
    *       function addTab(tabPanel, id) {
    *           var tab_id = 'document_'+id;
    *           var url = 'AnotoDocumentViewer.aspx?documentid='+id+'&amp;pageid=1&amp;clientid=1';
    *           var lcTitle = 'Document # ' + id + ' (Seite 1)';
    *           var tab = tabPanel.getComponent(tab_id);
    *           if (!tab) {
    *               tab = tabPanel.add({*
    *                   id: tab_id,*
    *                   title: lcTitle,*
    *                   closable:true,                   *
    *                   autoLoad: {
    *                       showMask: true,
    *                       url: url,
    *                       mode:'iframe',
    *                       maskMsg: 'Loading document ...'
    *                   }                   *
    *               });
    
    *               tab.on('activate', function() {
    *              *
    *                   Coolite.AjaxMethods.mmks_displaydocumentinfo(id, {*
    *                           eventMask : {
    *                               showMask: true
    *                           }
    *                       });
    
    *              }, this);
    *           }
    *           tabPanel.setActiveTab(tab);
    *       }
    *   </script>
    *

    When script executed I'v got an error about Coolite.AjaxMethods is null or not an object. When I suspend debuger and look the Coolite variable... this var does not contains AjaxMethods... Only "AjaxMethod,AjaxEvent and Ext" .

    Am I do something wrong?
  2. #2

    RE: JScript Error: Coolite.AjaxMethods is null or not an object



    Hello,

    Ok.. with null - problem was fixed.. because my AjaxMethod was not declared as Public... my mistake..

    but,

    Now no error.. and Method also not fired... When I place alert('Hello') instead Coolite.AjaxMethods.mmks_displaydocumentinfo - alert happens every time when page is Activated, so.. handler is correct. Why my method is not executed then?
    *
  3. #3

    RE: JScript Error: Coolite.AjaxMethods is null or not an object



    Finally, I understand whats happen.. the AjaxMethod don't understand Optional parameter.. *I pass only 1 parameter to AjaxMethod from JavaScript.. but server side method contains 3 parameters.. 1 main.. and 2 declared as optional.. so.. I must send from javascript code exact quantity of parameters.

    Thanks for attention.
    *

Similar Threads

  1. Replies: 7
    Last Post: Aug 12, 2011, 9:39 AM
  2. Replies: 3
    Last Post: Mar 04, 2011, 11:08 AM
  3. Replies: 0
    Last Post: Mar 04, 2011, 10:52 AM
  4. Replies: 2
    Last Post: Mar 12, 2010, 8:33 AM
  5. Replies: 0
    Last Post: Aug 27, 2009, 6:13 PM

Posting Permissions