Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 37164 invoked from network); 6 Jul 2004 16:18:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 6 Jul 2004 16:18:53 -0000 Received: (qmail 18077 invoked by uid 500); 6 Jul 2004 16:05:37 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 18023 invoked by uid 500); 6 Jul 2004 16:05:36 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 17996 invoked by uid 99); 6 Jul 2004 16:05:36 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received: from [80.91.224.249] (HELO main.gmane.org) (80.91.224.249) by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 06 Jul 2004 09:05:34 -0700 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BhrlD-0004v9-00 for ; Tue, 06 Jul 2004 17:21:36 +0200 Received: from mail.seitenbau.net ([194.175.229.106]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Jul 2004 17:21:31 +0200 Received: from hochleiter by mail.seitenbau.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Jul 2004 17:21:31 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: users@cocoon.apache.org From: Nicole Hochleiter Subject: CForms, binding with repeater, new element overwrites old element Date: Tue, 6 Jul 2004 15:21:29 +0000 (UTC) Lines: 55 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 194.175.229.106 (Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040614 Firefox/0.8) Sender: news X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N In stepping through org.apache.cocoon.forms.binding.RepeaterJXPathBinding public void doSave(Widget frmModel, JXPathContext jxpc) throws BindingException I got the impression, that my new added element overwrites an existing one. I'm working with bean binding, cocoon.2.1.5, Java 1.4.2. Is it a bug or did I miss something in the configuration? I got the idea that this is a bug, because I could fix this 'bug' in my special case in putting some lines into that class, like: (but I do not want to keep it) [...] //register the factory! while (rowIterator.hasNext()) { Repeater.RepeaterRow thisRow = (Repeater.RepeaterRow)rowIterator.next(); // Perform the insert row binding. this.insertRowBinding.saveFormToModel(repeater, repeaterContext); // --> create the path to let the context be created // -------- My FIX: the pointer pointed always to the last element, // whicht not automatically was the new one Pointer newRowContextPointer = null; for (int i=0 ; i <= indexCount; i++) { newRowContextPointer = repeaterContext.createPath(this.rowPathForInsert + "[" + i + "]"); Object valueObject = newRowContextPointer.getValue(); // here is where I check if it really is new (but it only works // with my objectmodel if (valueObject instanceof ONStructureElement) { if (((ONStructureElement)valueObject).isNew() && ((ONStructureElement)valueObject)._id==null) break; } } // this was the original line /*Pointer newRowContextPointer = repeaterContext.createPath( this.rowPathForInsert + "[" + indexCount + "]"); */ // -------- END My FIX JXPathContext newRowContext = repeaterContext.getRelativeContext(newRowContextPointer); if (getLogger().isDebugEnabled()) { getLogger().debug("inserted row at " + newRowContextPointer.asPath()); } // + rebind to children for update this.rowBinding.saveFormToModel(thisRow, newRowContext); getLogger().debug("bound new row"); indexCount++; } Is it really a bug or can I fix my problem in configuring something? TNX, Nicole --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org