Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 91667 invoked from network); 17 Jan 2007 17:35:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Jan 2007 17:35:37 -0000 Received: (qmail 83966 invoked by uid 500); 17 Jan 2007 17:35:39 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 83929 invoked by uid 500); 17 Jan 2007 17:35:39 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 83918 invoked by uid 99); 17 Jan 2007 17:35:39 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jan 2007 09:35:38 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=FORGED_HOTMAIL_RCVD2,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jan 2007 09:35:29 -0800 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1H7Egn-00062Q-Ei for users@myfaces.apache.org; Wed, 17 Jan 2007 09:35:09 -0800 Message-ID: <8414939.post@talk.nabble.com> Date: Wed, 17 Jan 2007 09:35:09 -0800 (PST) From: lightbulb432 To: users@myfaces.apache.org Subject: Re: Can dataTable's value be a HashSet? In-Reply-To: <45AA8CE0.9040508@rhe.co.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: veerukrishnan@hotmail.com References: <8329377.post@talk.nabble.com> <8c9d4eaa0701140429k6173dc97p52a0ff1ab07ca187@mail.gmail.com> <45AA8CE0.9040508@rhe.co.nz> X-Virus-Checked: Checked by ClamAV on apache.org Is it possible to plug in a Comparator to the dataTable operation somehow to enable a Set to be sorted based on that Comparator? In fact, this could be used as a sorting mechanism for any collection, couldn't it? Does such functionality exist? (I couldn't find anything in the Javadoc to indicate so.) Simon Kitching-3 wrote: > > And in general sets are not ordered, which doesn't make sense when > displaying data in a table. Read-only tables would be odd, but > implementing editable tables would be really nasty if the server-side > data structure that the table corresponds to could return its data in > any order. > > The JSF spec explicitly lists what collections are supported for UIData, > and Set is not one of them. > > Cagatay Civici wrote: >> Hi, >> >> It's not supported by UIData, because sets are not indexed. >> >> The workaround would be the wrapper you mentioned or a custom property >> resolver; >> >> http://www.jroller.com/page/mert?entry=settolistpropresolver_for_jsf_el >> >> Cagatay >> >> On 1/14/07, *lightbulb432* < veerukrishnan@hotmail.com >> > wrote: >> >> >> Can the value attribute of a h:dataTable be set to any Collection? I >> tried >> setting it to a Set (specifically, HashSet), but that gave trouble. >> To solve >> this, I added another property to the backing bean which simply >> wrapped that >> bean's Set in a List and used that as the value attribute, and then >> it >> worked fine! >> >> What is the reason that Sets/HashSets aren't allowed to be used? I >> sure hope >> there's a way to get it work, as many of my Collections are Sets and >> I >> wouldn't like to clutter my code with List wrappers just to make >> this work. >> -- >> View this message in context: >> >> http://www.nabble.com/Can-dataTable%27s-value-be-a-HashSet--tf2982099.html#a8329377 >> >> Sent from the MyFaces - Users mailing list archive at Nabble.com >> . >> >> > > > -- View this message in context: http://www.nabble.com/Can-dataTable%27s-value-be-a-HashSet--tf2982099.html#a8414939 Sent from the MyFaces - Users mailing list archive at Nabble.com.