cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pieter Delmee (JIRA)" <>
Subject [jira] Created: (COCOON-2030) submit-on-change doesn't work for a multivaluefield with list-type="checkbox"
Date Tue, 27 Mar 2007 11:59:32 GMT
submit-on-change doesn't work for a multivaluefield with list-type="checkbox"

                 Key: COCOON-2030
             Project: Cocoon
          Issue Type: Bug
          Components: Blocks: Forms
    Affects Versions: 2.1.11-dev (Current SVN)
            Reporter: Pieter Delmee

I have a form with a multivaluefield displayed as checkboxes. When one of the checkboxes is
checked or unchecked, I need the  fd:on-value-changed script to be executed. I believe this
should happen when the submit-on-change attribute is added to the fi:styling element in the

I added the following line in forms-field-styling.xsl to solve the problem.

      | fi:multivaluefield : produce a list of checkboxes
  <xsl:template match="fi:multivaluefield[fi:styling/@list-type='checkbox']">
    <xsl:variable name="id" select="@id"/>
    <xsl:variable name="values" select="fi:values/fi:value/text()"/>
    <xsl:variable name="state" select="@state" />

    <span id="{@id}" title="{fi:hint}">
      <xsl:for-each select="fi:selection-list/fi:item">
        <xsl:variable name="value" select="@value"/>
        <xsl:variable name="item-id" select="concat($id, ':', position())"/>
        <input id="{$item-id}" type="checkbox" value="{@value}" name="{$id}">
          <xsl:apply-templates select="." mode="css"/>
          <!-- added -->
          <xsl:apply-templates select="../.." mode="styling"/>

          <xsl:if test="$state = 'disabled'">
            <xsl:attribute name="disabled">disabled</xsl:attribute>
          <xsl:if test="$values[. = $value]">
            <xsl:attribute name="checked">checked</xsl:attribute>
        <xsl:apply-templates select="." mode="label">
          <xsl:with-param name="id" select="$item-id"/>
      <xsl:apply-templates select="." mode="common"/>

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message