Uploaded image for project: 'Cocoon'
  1. Cocoon
  2. COCOON-2011

[improvement and patch] CFormsSuggest widget does not implement the on value changed event available for most cocoon form widgets

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.10
    • 2.1.11, 2.2
    • Blocks: Ajax, Blocks: Forms
    • None
    • Patch available

    Description

      CFormsSuggest widget does not handle the on value changed event.

      in definition:
              <fd:field id="xxx">
                  <fd:label>xxx</fd:label>
                  <fd:datatype base="long"/>
                  <fd:suggestion-list type="javascript">
                      return xxx(filter);
                  </fd:suggestion-list>
                  <fd:on-value-changed>
                      <fd:javascript>
                          xxx_onValueChanged(event.source.getForm());
                      </fd:javascript>
                  </fd:on-value-changed>
              </fd:field>

      in template:

              <ft:widget id="xxx" type="suggest"/>

      the patch for CFormsSuggest.js adds the onValueChanged function

      onValueChanged: function(/*String*/ value){
      if(this.onchange == "cocoon.forms.submitForm(this)") {
      cocoon.forms.submitForm(this.domNode, this.name);
      }
      },

      Attachments

        1. CFormsSuggest_patch
          1 kB
          Paul Friedman

        Activity

          People

            antonio Antonio Gallardo Rivera
            pfriedman Paul Friedman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: