Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 24058 invoked from network); 14 Jan 2006 06:41:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Jan 2006 06:41:36 -0000 Received: (qmail 40011 invoked by uid 500); 14 Jan 2006 06:41:32 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 39594 invoked by uid 500); 14 Jan 2006 06:41:30 -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 List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 39578 invoked by uid 99); 14 Jan 2006 06:41:30 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jan 2006 22:41:29 -0800 X-ASF-Spam-Status: No, hits=1.7 required=10.0 tests=DNS_FROM_RFC_ABUSE,RCVD_IN_SORBS_WEB X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [68.142.200.116] (HELO web30503.mail.mud.yahoo.com) (68.142.200.116) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 13 Jan 2006 22:41:28 -0800 Received: (qmail 92688 invoked by uid 60001); 14 Jan 2006 06:41:07 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=XwQe7Ru3ms7ClQq33TL4u6DCNI0KjfILx7AxRmmBZDx5zWNj+LUxET770pGoAmNEqRUN4tUJ79YbR62lCtMdKlNJGjYftvbFlVOPCgSgRR2v41b2qVEGsGIiTb1N3vy633nx7KT362+7T5o9mux23rfwcw2mw+slwUn2dLSAMpA= ; Message-ID: <20060114064107.92686.qmail@web30503.mail.mud.yahoo.com> Received: from [62.140.137.30] by web30503.mail.mud.yahoo.com via HTTP; Sat, 14 Jan 2006 06:41:07 GMT Date: Sat, 14 Jan 2006 06:41:07 +0000 (GMT) From: Andre Cesta Reply-To: aacesta@yahoo.com Subject: Re: Binding selection boxes to beans in cocoon forms? To: users@cocoon.apache.org In-Reply-To: <20060111175352.92774.qmail@web30508.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Can anybody answer this? Perhaps send me an email with working selection box <-> bean binding classes/pipeline/forms example? --- Andre Cesta wrote: > Hi, > > I wonder if you can help me bind selection boxes to beans. > (other properties on this very same form are binding just fine) > > Code snippets and exception for my attempt are shown below. > I've searched the list archives and web without luck for solutions. The cocoon samples (car, > country selectors are for XML binding and did not help much on the bean binding side). > --------------------------------8<--------------------- > Software: a study project on the area of hotel rooms management, > where room type is (luxe, standard, etc). > --------------------------------8<--------------------- > Cocoon version: 2.1.7 > --Bean Room.java (also questions posed on comments----- > public class Room ... > .... > public Collection getRoomTypes() throws ... { > //returns a LinkedList by the way. > } > > public void setRoomType(RoomType roomType) { > //Should I also provide a overriden version with Long argument > //to set the room type for binding reasons? > ... > } > > public RoomType getRoomType() { > ... > } > --room_model.xml----------------8<--------------------- > ... > > > > value-path="id" /> > Room type: > > > ... > --Exception thrown by cocoon--------8<--------------------- > An Error Occurred > Incorrect value type for "data.roomType" (expected class java.lang.Long, got class > br.com.hotelman.datatypes.RoomType). > > org.apache.avalon.framework.CascadingRuntimeException: > "resource://org/apache/cocoon/forms/flow/javascript/Form.js", line 184: uncaught JavaScript > exception: at room (file:/C:/cocoon-2.1.7/build/webapp/forms2/flow/room.js, Line 28) at > (resource://org/apache/cocoon/forms/flow/javascript/Form.js, Line 184): > java.lang.RuntimeException: Incorrect value type for "data.roomType" (expected class > java.lang.Long, got class br.com.hotelman.datatypes.RoomType). > > cause: java.lang.RuntimeException: Incorrect value type for "data.roomType" (expected class > java.lang.Long, got class br.com.hotelman.datatypes.RoomType). > ---Room.js (flow)---------------8<--------------------- > function room(form) { > var id = cocoon.request.getParameter("id"); > var room = null; > room = Packages.br.com.hotelman.datatypes.Room.findById(id); > form.load(room); > form.showForm("room-display-pipeline"); > form.save(room); > cocoon.sendPage("room-success-pipeline", { "room": room }); > } > --Pipeline-----------------------8<--------------------- > > > > > > > > --Template room_template.xml----8<--------------------- > ... >
> > >
> ... > > ... > > ---room_bind_bean.xml-----------8<--------------------- > .... > > > > --------------------------------8<--------------------- > > Feel free to package your working selection box form files and > bean and send to aacesta@yahoo.com so I can use as example. > > Kind regards, Andre > > > > ___________________________________________________________ > NEW Yahoo! Cars - sell your car and browse thousands of new and used cars online! > http://uk.cars.yahoo.com/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org > For additional commands, e-mail: users-help@cocoon.apache.org > > ___________________________________________________________ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org