cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: rev 36654 - in cocoon/trunk/src/blocks: forms/samples/resources woody/samples/resources
Date Fri, 20 Aug 2004 07:33:37 GMT
Author: cziegeler
Date: Fri Aug 20 00:33:36 2004
New Revision: 36654

Modified:
   cocoon/trunk/src/blocks/forms/samples/resources/forms-field-styling.xsl
   cocoon/trunk/src/blocks/woody/samples/resources/woody-field-styling.xsl
Log:
Fix problem when booleanfield is hidden

Modified: cocoon/trunk/src/blocks/forms/samples/resources/forms-field-styling.xsl
==============================================================================
--- cocoon/trunk/src/blocks/forms/samples/resources/forms-field-styling.xsl	(original)
+++ cocoon/trunk/src/blocks/forms/samples/resources/forms-field-styling.xsl	Fri Aug 20 00:33:36
2004
@@ -20,7 +20,7 @@
                 exclude-result-prefixes="fi">
   <!--+
       | This stylesheet is designed to be included by 'forms-samples-styling.xsl'.
-      | Version CVS $Id: forms-field-styling.xsl,v 1.14 2004/07/01 23:45:45 joerg Exp $
+      | Version CVS $Id$
       +-->
 
   <!-- Location of the resources directory, where JS libs and icons are stored -->
@@ -264,13 +264,24 @@
 
   <!--+
       | fi:booleanfield : produce a checkbox
+      | A hidden booleanfield is not a checkbox, so 'value' contains 
+      | the value and not the checked attribute
       +-->
   <xsl:template match="fi:booleanfield">
     <input id="{@id}" type="checkbox" value="true" name="{@id}" title="{fi:hint}">
       <xsl:apply-templates select="." mode="styling"/>
-      <xsl:if test="fi:value = 'true'">
-        <xsl:attribute name="checked">checked</xsl:attribute>
-      </xsl:if>
+      <xsl:choose>
+        <xsl:when test="./fi:styling[@type='hidden']">
+          <xsl:if test="fi:value = 'false'">
+            <xsl:attribute name="value">false</xsl:attribute>
+          </xsl:if>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:if test="fi:value = 'true'">
+            <xsl:attribute name="checked">checked</xsl:attribute>
+          </xsl:if>
+        </xsl:otherwise>
+      </xsl:choose>
     </input>
     <xsl:apply-templates select="." mode="common"/>
   </xsl:template>

Modified: cocoon/trunk/src/blocks/woody/samples/resources/woody-field-styling.xsl
==============================================================================
--- cocoon/trunk/src/blocks/woody/samples/resources/woody-field-styling.xsl	(original)
+++ cocoon/trunk/src/blocks/woody/samples/resources/woody-field-styling.xsl	Fri Aug 20 00:33:36
2004
@@ -20,7 +20,7 @@
                 exclude-result-prefixes="wi">
   <!--+
       | This stylesheet is designed to be included by 'woody-samples-styling.xsl'.
-      | Version CVS $Id: woody-field-styling.xsl,v 1.48 2004/04/21 14:00:03 joerg Exp $
+      | Version CVS $Id$
       +-->
 
   <!-- Location of the resources directory, where JS libs and icons are stored -->
@@ -258,13 +258,24 @@
 
   <!--+
       | wi:booleanfield : produce a checkbox
+      | A hidden booleanfield is not a checkbox, so 'value' contains 
+      | the value and not the checked attribute
       +-->
   <xsl:template match="wi:booleanfield">
     <input id="{@id}" type="checkbox" value="true" name="{@id}" title="{wi:hint}">
       <xsl:apply-templates select="." mode="styling"/>
-      <xsl:if test="wi:value = 'true'">
-        <xsl:attribute name="checked">checked</xsl:attribute>
-      </xsl:if>
+      <xsl:choose>
+          <xsl:when test="./wi:styling[@type='hidden']">
+          <xsl:if test="wi:value = 'false'">
+            <xsl:attribute name="value">false</xsl:attribute>
+          </xsl:if>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:if test="wi:value = 'true'">
+            <xsl:attribute name="checked">checked</xsl:attribute>
+          </xsl:if>
+        </xsl:otherwise>
+      </xsl:choose>
     </input>
     <xsl:apply-templates select="." mode="common"/>
   </xsl:template>

Mime
View raw message