Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 18966 invoked from network); 6 Feb 2004 21:27:43 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 6 Feb 2004 21:27:43 -0000 Received: (qmail 81185 invoked by uid 500); 6 Feb 2004 21:26:59 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 81067 invoked by uid 500); 6 Feb 2004 21:26:58 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 80990 invoked by uid 500); 6 Feb 2004 21:26:57 -0000 Delivered-To: apmail-cocoon-2.1-cvs@apache.org Received: (qmail 80984 invoked from network); 6 Feb 2004 21:26:57 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 6 Feb 2004 21:26:57 -0000 Received: (qmail 18695 invoked by uid 1342); 6 Feb 2004 21:27:08 -0000 Date: 6 Feb 2004 21:27:08 -0000 Message-ID: <20040206212708.18694.qmail@minotaur.apache.org> From: vgritsenko@apache.org To: cocoon-2.1-cvs@apache.org Subject: cvs commit: cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel MultiValueField.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N vgritsenko 2004/02/06 13:27:08 Modified: src/blocks/woody/java/org/apache/cocoon/woody/formmodel MultiValueField.java Log: setValue(this.values) did not made any sense. Changed to setValue((Object[])value) Revision Changes Path 1.14 +11 -12 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/MultiValueField.java Index: MultiValueField.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/MultiValueField.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- MultiValueField.java 4 Feb 2004 17:25:57 -0000 1.13 +++ MultiValueField.java 6 Feb 2004 21:27:08 -0000 1.14 @@ -192,13 +192,12 @@ public Object getValue() { return values; } - + public void setValue(Object value) { if (value == null) { setValues(new Object[0]); - } - else if (value.getClass().isArray()) { - setValues(values); + } else if (value.getClass().isArray()) { + setValues((Object[])value); } else { throw new RuntimeException("Cannot set value of field \"" + getFullyQualifiedId() + "\" with an object of type " + value.getClass().getName()); } @@ -212,7 +211,7 @@ } this.values = values; } - + /** * Set this field's selection list. * @param selectionList The new selection list. @@ -226,20 +225,20 @@ } this.selectionList = selectionList; } - + /** * Read this field's selection list from an external source. - * All Cocoon-supported protocols can be used. - * The format of the XML produced by the source should be the + * All Cocoon-supported protocols can be used. + * The format of the XML produced by the source should be the * same as in case of inline specification of the selection list, * thus the root element should be a wd:selection-list * element. - * @param uri The URI of the source. + * @param uri The URI of the source. */ public void setSelectionList(String uri) { setSelectionList(this.fieldDefinition.buildSelectionList(uri)); } - + /** * Set this field's selection list using values from an in-memory * object. The object parameter should point to a collection @@ -250,9 +249,9 @@ * of every wd:item in the list. *

Access to the values of the above mentioned properties is done * via XPath expressions. - * @param model The collection used as a model for the selection list. + * @param model The collection used as a model for the selection list. * @param valuePath An XPath expression referring to the attribute used - * to populate the values of the list's items. + * to populate the values of the list's items. * @param labelPath An XPath expression referring to the attribute used * to populate the labels of the list's items. */