cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simone Gianni (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COCOON-1846) [PATCH] BooleanField and radio do not send on-value-changed at the rigth time with IE
Date Tue, 09 May 2006 16:28:05 GMT
    [ http://issues.apache.org/jira/browse/COCOON-1846?page=comments#action_12378647 ] 

Simone Gianni commented on COCOON-1846:
---------------------------------------

Has already been solved in 2.1.x / trunk . Thanks for the patch anyway ... you used a different
condition, i used :

<!-- IE does not react to a click with an onchange, as firefox does, so for radio and checkbox
put an onclick handler instead -->
<xsl:when test="local-name() = 'booleanfield' or fi:styling/@list-type = 'radio' or fi:styling/@list-type
= 'checkbox'">
  <xsl:attribute name="onclick">forms_submitForm(this)</xsl:attribute>
</xsl:when>
<xsl:otherwise>
  <xsl:attribute name="onchange">forms_submitForm(this)</xsl:attribute>
</xsl:otherwise>

I think yours is better, could you explain why you used that conditions?

> [PATCH] BooleanField and radio do not send on-value-changed at the rigth time with IE
> -------------------------------------------------------------------------------------
>
>          Key: COCOON-1846
>          URL: http://issues.apache.org/jira/browse/COCOON-1846
>      Project: Cocoon
>         Type: Bug

>   Components: Blocks: Forms
>     Versions: 2.1.9
>     Reporter: vincent Demay
>     Assignee: Simone Gianni

>
> BooleanField and radio list do not send on-value-changed event when the value changed
but when the widget loose focus with IE.
> So with ajax mode and submit-on-change='true', the form is submitted only when the widget
lost the focus. 
> Here is a patch to use event onclick rather than on value change : 
> --- forms-field-styling.xsl     2006-05-09 14:53:40.014409000 +0200
> +++ forms-field-styling.xsl     2006-05-09 14:45:01.499752000 +0200
> @@ -91,11 +91,20 @@
>        +-->
>    <xsl:template match="fi:*" mode="styling">
>      <xsl:apply-templates select="fi:styling/@*" mode="styling"/>
> -
>      <!--  Auto submit on fields which are listening -->
> -      <xsl:if test="@listening = 'true' and not(fi:styling/@submit-on-change ='false')
and not(fi:styling/@onchange) and not(fi:styling/@list-type = 'double-listbox')">
> -      <xsl:attribute name="onchange">forms_submitForm(this)</xsl:attribute>
> -    </xsl:if>
> +    <xsl:choose>
> +       <xsl:when test="name() = 'fi:booleanfield' or fi:styling/@list-type = 'radio'
">
> +                <xsl:if test="@listening = 'true' and not(fi:styling/@submit-on-change
= 'false') and not(fi:styling/@onchange) and not(fi:styling/@list-type = 'double-listbox')">
> +                       <xsl:attribute name="onclick">forms_submitForm(this)</xsl:attribute>
> +               </xsl:if>
> +       </xsl:when>
> +       <xsl:otherwise>
> +               <xsl:if test="@listening = 'true' and not(fi:styling/@submit-on-change
= 'false') and not(fi:styling/@onchange) and not(fi:styling/@list-type ='double-listbox')">
> +                       <xsl:attribute name="onchange">forms_submitForm(this)</xsl:attribute>
> +               </xsl:if>
> +       </xsl:otherwise>
> +    </xsl:choose>
> +
>      <xsl:if test="@state = 'disabled'">
>        <xsl:attribute name="disabled">disabled</xsl:attribute>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message