November Happy Hour will be moved to Thursday December 5th.

Simple Gadget - Cannot read property 'guid' of undefined

Vote:
 

Hello,

I am building a simple gadget where I have some inout fields and a Submit button that executes a javascript to read the form fields and display a result on the gadget.

I read a number of articles, looked at the QuickChat sample but whetever I do, I can't make it work.

if I include the [Gadget(ClientScriptInitMethod = "URLBuilderGadget.init")] instead of [Gadget], I receive the following message which is displayed before the form:

Cannot read property 'guid' of undefined

The javascript is very simple:

require(["dojo/domReady!"],(function($, epi) {
        epi.URLBuilderGadget = function () {
      // object returned by function.
      // Exposes public methods and variables.
      var pub = {};
      pub.init = function(e, gadget) {
          $(this).bind("epigadgetsubmit",
          gadgetSubmit);
      };
      var gadgetSubmit = function (e, gadget)
      {
          alert('Submit Click');
      };
      return pub;
  } ();
} (epiJQuery, epi)));

The Index.cshtml is:

@{
    Layout = null;
}


   

       

            URL Builder
           

               
               
           

                        
       

   

The submit action is not working. 

This is on EPiServer 7.5.

Many thanks

Yannis

#119455
Mar 28, 2015 0:48
Vote:
 

Did you ever solve this? I'm seeing the exact same thing.

#172007
Nov 23, 2016 11:23
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.