Cocoon
  1. Cocoon
  2. COCOON-1822

MultiValueField list-type="double-listbox" does not work correctly in ajax enabled forms

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.9
    • Fix Version/s: 2.1.12, 2.2.1
    • Component/s: Blocks: Forms
    • Labels:
      None
    • Urgency:
      Urgent

      Description

      The multi value field with fi:styling list-type="double-listbox" relies on forms_onsubmitHandlers to select all items in the right selection list before submitting. In an ajax form, it seems like forms_onsubmit is not installed on the form, so handlers are not called; in forms-field-styling.xsl this is clearly stated :

            <xsl:choose>
              <xsl:when test="@ajax = 'true'">
                <xsl:attribute name="dojoType">CFormsForm</xsl:attribute>
                <xsl:if test="@ajax = 'true'">
                  <script type="text/javascript">cocoon.forms.ajax = true;</script>
                </xsl:if>
              </xsl:when>
              <xsl:otherwise>
                <xsl:attribute name="onsubmit">forms_onsubmit(); <xsl:value-of select="@onsubmit"/></xsl:attribute>
              </xsl:otherwise>
            </xsl:choose>

      I don't think installing forms_onsubmit() also on ajax forma is a wise solution, but maybe we should call it from inside the ajax code, or at least check and execute onsubmit_handlers. If not, also the free-form multivalue field editor will not work correctly.

      What's the best way to fix this issue?

        Activity

        Hide
        Karen Torres added a comment -
        Dojo-fied version of the multivalue double list widget.
        Show
        Karen Torres added a comment - Dojo-fied version of the multivalue double list widget.
        Hide
        Antonio Gallardo added a comment -
        Patch applied to 2.1.12-dev.
        Show
        Antonio Gallardo added a comment - Patch applied to 2.1.12-dev.
        Hide
        Felix Knecht added a comment -
        Patch applied to cocoon-forms-impl 1.2.0-SNAPSHOT (cocoon-2.2)
        Show
        Felix Knecht added a comment - Patch applied to cocoon-forms-impl 1.2.0-SNAPSHOT (cocoon-2.2)
        Hide
        Cédric Damioli added a comment -
        It seems that this issue has been actually closed more than 4 years ago (patch committed in revision 675789 in the 2.1 branch)
        Show
        Cédric Damioli added a comment - It seems that this issue has been actually closed more than 4 years ago (patch committed in revision 675789 in the 2.1 branch)

          People

          • Assignee:
            Antonio Gallardo
            Reporter:
            Simone Gianni
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development