3 Replies Latest reply on Mar 13, 2013 4:25 PM by albinomouse

    Error when adding listeners to components

    albinomouse

      I keep getting this error when trying to add listeners:

       

      Uncaught TypeError: Object function(...) { console.log(value); } has no method 'apply'

       

      The listeners I've been trying include "beforeshow", "selectionchanged", etc.  I'm adding the handlers underneath a "listeners" node of jcr:primaryType nt:unstructured directly underneath the node I am interested in.  All I've been trying to do is to console.log(this).

       

      Example (extra info removed):

       

      <displaytype

                          jcr:primaryType="cq:Widget"

                          name="./displayType"

                          type="select"

                          xtype="selection">

                          <options jcr:primaryType="cq:WidgetCollection">

                              <o1

                                  jcr:primaryType="nt:unstructured"

                                  text="..."

                                  value="..."/>

                              <o2

                                 ... />

                              <o3

                                 .. ./>

                              <o4

                                  .. ./>

                          </options>

                          <listeners

                               jcr:primaryType="nt:unstructured"

                               selectionchanged="function(this, value, isChecked) { console.log(value); }"

                           /> ...

                      </displaytype>

       

       

      What could this error refer to?