cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject svn commit: rev 56591 - in cocoon/trunk/src/blocks/forms/samples: forms resources
Date Thu, 04 Nov 2004 13:08:52 GMT
Author: sylvain
Date: Thu Nov  4 05:08:51 2004
New Revision: 56591

Modified:
   cocoon/trunk/src/blocks/forms/samples/forms/carselector_form.xml
   cocoon/trunk/src/blocks/forms/samples/forms/datasource_chooser_template.xml
   cocoon/trunk/src/blocks/forms/samples/resources/forms-advanced-field-styling.xsl
   cocoon/trunk/src/blocks/forms/samples/resources/forms-calendar-styling.xsl
   cocoon/trunk/src/blocks/forms/samples/resources/forms-field-styling.xsl
Log:
merging 2.1 and 2.2

Modified: cocoon/trunk/src/blocks/forms/samples/forms/carselector_form.xml
==============================================================================
--- cocoon/trunk/src/blocks/forms/samples/forms/carselector_form.xml	(original)
+++ cocoon/trunk/src/blocks/forms/samples/forms/carselector_form.xml	Thu Nov  4 05:08:51 2004
@@ -32,9 +32,11 @@
           if (value != null) {
             // Get the corresponding type list
             typewidget.setSelectionList("cocoon:/cars/" + value);
+            typewidget.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
           } else {
             // Set an empty selection list
             typewidget.setSelectionList(new Packages.org.apache.cocoon.forms.datatype.EmptySelectionList("Select
a maker first"));
+            typewidget.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.DISABLED);
           }
           // Always set the type value to null. Note that it will also fire an event on the
"type"
           // widget if it already had a value.
@@ -55,7 +57,7 @@
       </fd:on-value-changed>
     </fd:field>
   
-    <fd:field id="type" required="true">
+    <fd:field id="type" required="true" state="disabled">
       <fd:label>Type:</fd:label>
       <fd:datatype base="string"/>
       <fd:selection-list>
@@ -71,9 +73,11 @@
           var makewidget = event.source.lookupWidget("../make");
           if (value != null) {
             modelwidget.setSelectionList("cocoon:/cars/" + makewidget.value + "/" + value);
+            modelwidget.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
           } else {
             // Set an empty selection list
             modelwidget.setSelectionList(new Packages.org.apache.cocoon.forms.datatype.EmptySelectionList("Select
a type first"));
+            modelwidget.setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.INVISIBLE);
           }
           
           // Always set the model value to null. Note that it will also fire an event on
the "model"
@@ -93,7 +97,7 @@
       </fd:on-value-changed>
     </fd:field>
     
-    <fd:field id="model" required="true">
+    <fd:field id="model" required="true" state="invisible">
       <fd:label>Model:</fd:label>
       <fd:datatype base="string"/>
       <fd:selection-list>

Modified: cocoon/trunk/src/blocks/forms/samples/forms/datasource_chooser_template.xml
==============================================================================
--- cocoon/trunk/src/blocks/forms/samples/forms/datasource_chooser_template.xml	(original)
+++ cocoon/trunk/src/blocks/forms/samples/forms/datasource_chooser_template.xml	Thu Nov  4
05:08:51 2004
@@ -57,6 +57,8 @@
       <br/>
       
       <ft:widget id="ok"/>
+      <br/>
+      <a href="./do-datasourceChooser.flow">Restart this sample</a> -  <a
href="./">Back to samples</a>
 
     </ft:form-template>
   </content>

Modified: cocoon/trunk/src/blocks/forms/samples/resources/forms-advanced-field-styling.xsl
==============================================================================
--- cocoon/trunk/src/blocks/forms/samples/resources/forms-advanced-field-styling.xsl	(original)
+++ cocoon/trunk/src/blocks/forms/samples/resources/forms-advanced-field-styling.xsl	Thu Nov
 4 05:08:51 2004
@@ -123,19 +123,35 @@
             <!-- command buttons -->
             <!-- strangely, IE adds an extra blank line if there only a button on a line.
So we surround it with nbsp -->
             <xsl:text>&#160;</xsl:text>
-            <input type="button" value="&gt;" onclick="opt{generate-id()}.forms_transferRight()"/>
+            <input type="button" value="&gt;" onclick="opt{generate-id()}.forms_transferRight()">
+              <xsl:if test="@state='disabled'">
+                <xsl:attribute name="disabled">disabled</xsl:attribute>
+              </xsl:if>
+            </input>
             <xsl:text>&#160;</xsl:text>
             <br/>
             <xsl:text>&#160;</xsl:text>
-            <input type="button" value="&gt;&gt;" onclick="opt{generate-id()}.forms_transferAllRight()"/>
+            <input type="button" value="&gt;&gt;" onclick="opt{generate-id()}.forms_transferAllRight()">
+              <xsl:if test="@state='disabled'">
+                <xsl:attribute name="disabled">disabled</xsl:attribute>
+              </xsl:if>
+            </input>
             <xsl:text>&#160;</xsl:text>
             <br/>
             <xsl:text>&#160;</xsl:text>
-            <input type="button" value="&lt;" onclick="opt{generate-id()}.forms_transferLeft()"/>
+            <input type="button" value="&lt;" onclick="opt{generate-id()}.forms_transferLeft()">
+              <xsl:if test="@state='disabled'">
+                <xsl:attribute name="disabled">disabled</xsl:attribute>
+              </xsl:if>
+            </input>
             <xsl:text>&#160;</xsl:text>
             <br/>
             <xsl:text>&#160;</xsl:text>
-            <input type="button" value="&lt;&lt;" onclick="opt{generate-id()}.forms_transferAllLeft()"/>
+            <input type="button" value="&lt;&lt;" onclick="opt{generate-id()}.forms_transferAllLeft()">
+              <xsl:if test="@state='disabled'">
+                <xsl:attribute name="disabled">disabled</xsl:attribute>
+              </xsl:if>
+            </input>
             <xsl:text>&#160;</xsl:text>
             <br/>
             <xsl:apply-templates select="." mode="common"/>

Modified: cocoon/trunk/src/blocks/forms/samples/resources/forms-calendar-styling.xsl
==============================================================================
--- cocoon/trunk/src/blocks/forms/samples/resources/forms-calendar-styling.xsl	(original)
+++ cocoon/trunk/src/blocks/forms/samples/resources/forms-calendar-styling.xsl	Thu Nov  4
05:08:51 2004
@@ -69,11 +69,19 @@
     </input>
     
     <!-- calendar popup -->
-    <a href="#" name="{$id}" id="{$id}"
-       onClick="forms_calendar.select(forms_getForm(this)['{@id}'],'{$id}','{$format}');
return false;">
-      <!-- TODO: i18n key for @alt -->
-      <img src="{$resources-uri}/cal.gif" alt="Calendar"/>
-    </a>
+    <xsl:choose>
+      <xsl:when test="@state = 'disabled'">
+        <!-- TODO: i18n key for @alt -->
+        <img src="{$resources-uri}/cal.gif" alt="Calendar"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <a href="#" name="{$id}" id="{$id}"
+           onclick="forms_calendar.select(forms_getForm(this)['{@id}'],'{$id}','{$format}');
return false;">
+          <!-- TODO: i18n key for @alt -->
+          <img src="{$resources-uri}/cal.gif" alt="Calendar"/>
+        </a>
+      </xsl:otherwise>
+    </xsl:choose>
 
     <!-- common stuff -->
     <xsl:apply-templates select="." mode="common"/>

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	Thu Nov  4 05:08:51
2004
@@ -66,6 +66,10 @@
   <xsl:template match="fi:*" mode="styling">
     <xsl:apply-templates select="fi:styling/@*" mode="styling"/>
 
+  	<xsl:if test="@state = 'disabled'">
+  		<xsl:attribute name="disabled">disabled</xsl:attribute>
+  	</xsl:if>
+
     <!--+ 
         | @listbox-size needs to be handled separately as even if it is not
         | specified some output (@size) must be generated.

Mime
View raw message