joerg 2004/05/11 15:44:41
Modified: src/blocks/forms/samples/resources forms-lib.js
forms-advanced-field-styling.xsl
src/blocks/woody/samples/resources woody-lib.js
woody-advanced-field-styling.xsl
Log:
fixed submit-on-change for [EMAIL PROTECTED]'double-listbox']
(http://marc.theaimsgroup.com/?t=108411824400003&r=1&w=4)
Revision Changes Path
1.3 +28 -3
cocoon-2.1/src/blocks/forms/samples/resources/forms-lib.js
Index: forms-lib.js
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/forms/samples/resources/forms-lib.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- forms-lib.js 10 Mar 2004 21:52:00 -0000 1.2
+++ forms-lib.js 11 May 2004 22:44:41 -0000 1.3
@@ -83,7 +83,7 @@
* This is required for help popups inside <wi:group> tabs. The reason is
that CSS positioning
* properties ("left" and "top") on a block with a "position: absolute" are
actually relative to
* the nearest ancestor that has a position of "absolute", "relative" or
"fixed".
- * See http://www.w3.org/TR/CSS21/visudet.html#containing-block-details �4
+ * See http://www.w3.org/TR/CSS21/visudet.html#containing-block-details �4
*/
function forms_moveInBody(element) {
@@ -109,7 +109,7 @@
}
-function forms_createOptionTransfer(id) {
+function forms_createOptionTransfer(id, submitOnChange) {
var result = new OptionTransfer(id + ".unselected", id);
result.setAutoSort(true);
// add to onload handlers
@@ -120,6 +120,31 @@
sortSelect(this.left);
sortSelect(this.right);
}
+ result.submitOnChange = submitOnChange;
+ result.forms_transferLeft = function() {
+ this.transferLeft();
+ if (this.submitOnChange) {
+ forms_submitForm(document.getElementById(this.forms_id));
+ }
+ }
+ result.forms_transferRight = function() {
+ this.transferRight();
+ if (this.submitOnChange) {
+ forms_submitForm(document.getElementById(this.forms_id));
+ }
+ }
+ result.forms_transferAllLeft = function() {
+ this.transferAllLeft();
+ if (this.submitOnChange) {
+ forms_submitForm(document.getElementById(this.forms_id));
+ }
+ };
+ result.forms_transferAllRight = function() {
+ this.transferAllRight();
+ if (this.submitOnChange) {
+ forms_submitForm(document.getElementById(this.forms_id));
+ }
+ };
forms_onloadHandlers.push(result);
// add to onsubmit handlers
1.6 +9 -7
cocoon-2.1/src/blocks/forms/samples/resources/forms-advanced-field-styling.xsl
Index: forms-advanced-field-styling.xsl
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/forms/samples/resources/forms-advanced-field-styling.xsl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- forms-advanced-field-styling.xsl 6 Apr 2004 21:33:15 -0000 1.5
+++ forms-advanced-field-styling.xsl 11 May 2004 22:44:41 -0000 1.6
@@ -103,7 +103,7 @@
<td>
<!-- select for the unselected values -->
<select id="[EMAIL PROTECTED]" name="[EMAIL PROTECTED]"
multiple="multiple"
- ondblclick="opt{generate-id()}.transferRight()">
+ ondblclick="opt{generate-id()}.forms_transferRight()">
<xsl:apply-templates select="." mode="styling"/>
<xsl:for-each select="fi:selection-list/fi:item">
<xsl:variable name="value" select="@value"/>
@@ -119,19 +119,19 @@
<!-- 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> </xsl:text>
- <input type="button" value=">"
onclick="opt{generate-id()}.transferRight()"/>
+ <input type="button" value=">"
onclick="opt{generate-id()}.forms_transferRight()"/>
<xsl:text> </xsl:text>
<br/>
<xsl:text> </xsl:text>
- <input type="button" value=">>"
onclick="opt{generate-id()}.transferAllRight()"/>
+ <input type="button" value=">>"
onclick="opt{generate-id()}.forms_transferAllRight()"/>
<xsl:text> </xsl:text>
<br/>
<xsl:text> </xsl:text>
- <input type="button" value="<"
onclick="opt{generate-id()}.transferLeft()"/>
+ <input type="button" value="<"
onclick="opt{generate-id()}.forms_transferLeft()"/>
<xsl:text> </xsl:text>
<br/>
<xsl:text> </xsl:text>
- <input type="button" value="<<"
onclick="opt{generate-id()}.transferAllLeft()"/>
+ <input type="button" value="<<"
onclick="opt{generate-id()}.forms_transferAllLeft()"/>
<xsl:text> </xsl:text>
<br/>
<xsl:apply-templates select="." mode="common"/>
@@ -139,7 +139,7 @@
<td>
<!-- select for the selected values -->
<select id="[EMAIL PROTECTED]" name="[EMAIL PROTECTED]"
multiple="multiple"
- ondblclick="opt{generate-id()}.transferLeft()" >
+ ondblclick="opt{generate-id()}.forms_transferLeft()" >
<xsl:apply-templates select="." mode="styling"/>
<xsl:for-each select="fi:selection-list/fi:item">
<xsl:variable name="value" select="@value"/>
@@ -154,9 +154,11 @@
</tr>
</table>
<script type="text/javascript">
- var opt<xsl:value-of select="generate-id()"/> =
forms_createOptionTransfer('<xsl:value-of select="@id"/>');
+ var opt<xsl:value-of select="generate-id()"/> =
forms_createOptionTransfer('<xsl:value-of select="@id"/>', <xsl:value-of
select="fi:styling/@submit-on-change = 'true'"/>);
</script>
</span>
</xsl:template>
+
+ <xsl:template match="fi:multivaluefield/fi:[EMAIL
PROTECTED]'double-listbox']/@submit-on-change" mode="styling"/>
</xsl:stylesheet>
1.7 +26 -1
cocoon-2.1/src/blocks/woody/samples/resources/woody-lib.js
Index: woody-lib.js
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/woody/samples/resources/woody-lib.js,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- woody-lib.js 11 May 2004 22:22:32 -0000 1.6
+++ woody-lib.js 11 May 2004 22:44:41 -0000 1.7
@@ -109,7 +109,7 @@
}
-function woody_createOptionTransfer(id) {
+function woody_createOptionTransfer(id, submitOnChange) {
var result = new OptionTransfer(id + ".unselected", id);
result.setAutoSort(true);
// add to onload handlers
@@ -120,6 +120,31 @@
sortSelect(this.left);
sortSelect(this.right);
}
+ result.submitOnChange = submitOnChange;
+ result.woody_transferLeft = function() {
+ this.transferLeft();
+ if (this.submitOnChange) {
+ woody_submitForm(document.getElementById(this.woody_id));
+ }
+ }
+ result.woody_transferRight = function() {
+ this.transferRight();
+ if (this.submitOnChange) {
+ woody_submitForm(document.getElementById(this.woody_id));
+ }
+ }
+ result.woody_transferAllLeft = function() {
+ this.transferAllLeft();
+ if (this.submitOnChange) {
+ woody_submitForm(document.getElementById(this.woody_id));
+ }
+ };
+ result.woody_transferAllRight = function() {
+ this.transferAllRight();
+ if (this.submitOnChange) {
+ woody_submitForm(document.getElementById(this.woody_id));
+ }
+ };
woody_onloadHandlers.push(result);
// add to onsubmit handlers
1.13 +9 -7
cocoon-2.1/src/blocks/woody/samples/resources/woody-advanced-field-styling.xsl
Index: woody-advanced-field-styling.xsl
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/woody/samples/resources/woody-advanced-field-styling.xsl,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- woody-advanced-field-styling.xsl 22 Mar 2004 13:16:37 -0000 1.12
+++ woody-advanced-field-styling.xsl 11 May 2004 22:44:41 -0000 1.13
@@ -103,7 +103,7 @@
<td>
<!-- select for the unselected values -->
<select id="[EMAIL PROTECTED]" name="[EMAIL PROTECTED]"
multiple="multiple"
- ondblclick="opt{generate-id()}.transferRight()">
+ ondblclick="opt{generate-id()}.woody_transferRight()">
<xsl:apply-templates select="." mode="styling"/>
<xsl:for-each select="wi:selection-list/wi:item">
<xsl:variable name="value" select="@value"/>
@@ -119,19 +119,19 @@
<!-- 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> </xsl:text>
- <input type="button" value=">"
onclick="opt{generate-id()}.transferRight()"/>
+ <input type="button" value=">"
onclick="opt{generate-id()}.woody_transferRight()"/>
<xsl:text> </xsl:text>
<br/>
<xsl:text> </xsl:text>
- <input type="button" value=">>"
onclick="opt{generate-id()}.transferAllRight()"/>
+ <input type="button" value=">>"
onclick="opt{generate-id()}.woody_transferAllRight()"/>
<xsl:text> </xsl:text>
<br/>
<xsl:text> </xsl:text>
- <input type="button" value="<"
onclick="opt{generate-id()}.transferLeft()"/>
+ <input type="button" value="<"
onclick="opt{generate-id()}.woody_transferLeft()"/>
<xsl:text> </xsl:text>
<br/>
<xsl:text> </xsl:text>
- <input type="button" value="<<"
onclick="opt{generate-id()}.transferAllLeft()"/>
+ <input type="button" value="<<"
onclick="opt{generate-id()}.woody_transferAllLeft()"/>
<xsl:text> </xsl:text>
<br/>
<xsl:apply-templates select="." mode="common"/>
@@ -139,7 +139,7 @@
<td>
<!-- select for the selected values -->
<select id="[EMAIL PROTECTED]" name="[EMAIL PROTECTED]"
multiple="multiple"
- ondblclick="opt{generate-id()}.transferLeft()" >
+ ondblclick="opt{generate-id()}.woody_transferLeft()" >
<xsl:apply-templates select="." mode="styling"/>
<xsl:for-each select="wi:selection-list/wi:item">
<xsl:variable name="value" select="@value"/>
@@ -154,9 +154,11 @@
</tr>
</table>
<script type="text/javascript">
- var opt<xsl:value-of select="generate-id()"/> =
woody_createOptionTransfer('<xsl:value-of select="@id"/>');
+ var opt<xsl:value-of select="generate-id()"/> =
woody_createOptionTransfer('<xsl:value-of select="@id"/>', <xsl:value-of
select="wi:styling/@submit-on-change = 'true'"/>);
</script>
</span>
</xsl:template>
+
+ <xsl:template match="wi:multivaluefield/wi:[EMAIL
PROTECTED]'double-listbox']/@submit-on-change" mode="styling"/>
</xsl:stylesheet>