AnsweredAssumed Answered

'remote' not found

Question asked by spatils on Aug 31, 2009
Latest reply on Sep 2, 2009 by spatils
Hello Experts,
I am creating a custom page in Share. I have created my own template. But when I try to access repository using
remote.connect("alfresco"); it is not finding remote object.
How to initialise remote object?
Please find sample js code below

(function()
{
   /*
    * sample constant value
    * @property MY_CONSTANT
    * @type int
    * @private
    */
   var MY_CONSTANT = 101;

   /**
    * Alfresco.SampleTemplate constructor.
    * @return {Alfresco.SampleTemplate} the new instance
    */
   Alfresco.UserHomePage = function UserHomePage_constructor()
   {
      /*
       * Request YUI Components
       * TODO: Update component list for specific requirements.
       * Note: If no YUI dependency, replace component list with empty array [].
      */
      Alfresco.util.YUILoaderHelper.require(["button"], this.onComponentsLoaded, this);

      return this;
   };

   Alfresco.UserHomePage.prototype =
   {
      /**
       * Fired by YUILoaderHelper when required component script files have
       * been loaded into the browser.
       * @method  onComponentsLoaded
       */
      onComponentsLoaded: function SampleTemplate_onComponentsLoaded()
      {
         /* Register the onReady callback when the DOM has been loaded */
         YAHOO.util.Event.onDOMReady(this.onReady, this, true);
      },
     
     
      /**
       * Fired by YUI when template's DOM has been constructed and ready for use.
       * @method  onReady
       */
      onReady: function UserHomePage_onReady()
      {
         /* TODO: Initialisation code, e.g. create YUI components. */
         function callokclickf(e){
            alert("Inside callokclickf");
          [i][b]  var connector = remote.connect("alfresco");[/b][/i]
        };
         YAHOO.util.Event.addListener("ok1","click",callokclickf);
      },
      _msg: function DLTB__msg(messageId)
      {
      return Alfresco.util.message.call(this, messageId, "Alfresco.UserHomePage", Array.prototype.slice.call(arguments).slice(1));
      }
   };
})();

/* Instantiate the template object as soon as it has been declared */
new Alfresco.UserHomePage();

Outcomes