You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Pieter Delmee (JIRA)" <ji...@apache.org> on 2007/03/27 14:27:32 UTC

[jira] Updated: (COCOON-2030) submit-on-change doesn't work for a multivaluefield with list-type="checkbox"

     [ https://issues.apache.org/jira/browse/COCOON-2030?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pieter Delmee updated COCOON-2030:
----------------------------------

    Attachment: forms-field-styling.patch

Patch for the described change

> submit-on-change doesn't work for a multivaluefield with list-type="checkbox"
> -----------------------------------------------------------------------------
>
>                 Key: COCOON-2030
>                 URL: https://issues.apache.org/jira/browse/COCOON-2030
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Forms
>    Affects Versions: 2.1.11-dev (Current SVN)
>            Reporter: Pieter Delmee
>         Attachments: forms-field-styling.patch
>
>
> 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 template.
> 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>
>           <xsl:if test="$values[. = $value]">
>             <xsl:attribute name="checked">checked</xsl:attribute>
>           </xsl:if>
>         </input>
>         <xsl:apply-templates select="." mode="label">
>           <xsl:with-param name="id" select="$item-id"/>
>         </xsl:apply-templates>
>         <br/>
>       </xsl:for-each>
>       <xsl:apply-templates select="." mode="common"/>
>     </span>
>   </xsl:template>

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