Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 11108 invoked from network); 23 May 2005 17:29:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 May 2005 17:29:42 -0000 Received: (qmail 92322 invoked by uid 500); 23 May 2005 16:25:37 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 92309 invoked by uid 500); 23 May 2005 16:25: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 List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 92295 invoked by uid 99); 23 May 2005 16:25: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-SPF: pass (hermes.apache.org: domain of jc.textor@gmx.de designates 213.165.64.20 as permitted sender) Received: from imap.gmx.net (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.28) with SMTP; Mon, 23 May 2005 09:25:36 -0700 Received: (qmail invoked by alias); 23 May 2005 16:25:33 -0000 Received: from i3ED61E15.versanet.de (EHLO [192.168.0.23]) [62.214.30.21] by mail.gmx.net (mp029) with SMTP; 23 May 2005 18:25:33 +0200 X-Authenticated: #2236490 Message-ID: <429203FC.2080706@gmx.de> Date: Mon, 23 May 2005 18:25:32 +0200 From: Johannes Textor User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050404) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: [CForms] Getting selectedValues from a multivaluefield ? References: <1471899234.20050522134041@maukisch.net> <42907158.5080108@gmx.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N >Please help ! I tried to find a solution in samples but the only >multivaluefield I found was not used from flowscript. The whole form >is just forwarded to some XSP logicsheet as a request parameter. > > > Maybe you cannot pass the model.userRoles directly. Keep in mind that the flowscript form binding is designed to work from JavaScript, not Java. I'm using a loop to feed the values to my Hibernate Object like this: *if*(model.rubriken.length>0) { * for*( *var* i = 0 ; i < model.rubriken.length; i++ ) artikel.getRubriken().add(hs.load(Rubrik,*new* java.lang.Long(model.rubriken[i]))); } hs is the Hibernate Session which I'm using from flowscript, but never mind. The problem is that there is no way I'm aware of to create native Java Arrays in flowscript (because JavaScript Arrays are really a different type of object !) The only solution I can think of is to refactor your createUser method to accept a Vector of objects rather than a String[], and then do: model = form.getModel(); var roles = new java.util.Vector(); for( var i = 0 ; i < model.userRoles.length ; i ++ ) roles.add( new java.lang.String( model.userRoles[i] ) ); user = schaman.createUser( model.userName, DigestUtils.md5Hex(model.password), model.userActive, model.userEmail, roles ); Yes I know it's ugly, can somebody come up with a better solution ? Because I've had exactly the same problem and could not come up with a better solution than the one described above. But maybe that is because CForms is designed to be smoothly used from JavaScript, and I found the conversion between JavaScript and Java painful at times. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org