Return-Path: X-Original-To: apmail-pivot-user-archive@www.apache.org Delivered-To: apmail-pivot-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 25A50614F for ; Wed, 22 Jun 2011 20:08:54 +0000 (UTC) Received: (qmail 93085 invoked by uid 500); 22 Jun 2011 20:08:54 -0000 Delivered-To: apmail-pivot-user-archive@pivot.apache.org Received: (qmail 93048 invoked by uid 500); 22 Jun 2011 20:08:54 -0000 Mailing-List: contact user-help@pivot.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@pivot.apache.org Delivered-To: mailing list user@pivot.apache.org Received: (qmail 93040 invoked by uid 99); 22 Jun 2011 20:08:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2011 20:08:53 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [195.159.29.9] (HELO mailstore05.sysedata.no) (195.159.29.9) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2011 20:08:45 +0000 Received: from [95.34.243.130] (helo=[10.0.1.190]) by mailstore05.sysedata.no with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1QZTiq-00039c-Oj for user@pivot.apache.org; Wed, 22 Jun 2011 22:08:24 +0200 Message-ID: <4E024BB7.7050304@sysedata.no> Date: Wed, 22 Jun 2011 22:08:23 +0200 From: Edvin Syse User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; nb-NO; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: user@pivot.apache.org Subject: Re: No support for Map in BeanAdapter? References: <4E0241A4.3010907@sysedata.no> <9D48B54E-CCCF-4876-8E3B-28218C56580D@verizon.net> <4E02476E.1010105@sysedata.no> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Den 22.06.2011 22:03, skrev Greg Brown: >>> I think this has come up before. BeanAdapter wraps a single bean instance and exposes its (immediate) properties via map methods. You can access nested properties using JSON.get(), put(), etc. >>> >>> However, TableView does not currently expect paths in column names, only keys. It could be modified to use JSON.get() instead, but I'm on the fence about whether that is a good idea or not. >> >> I think it looks like TableView already supports paths in column names. TableView#load calls: >> >> JSON.get(context, tableDataKey) >> >> and JSON#get will call parse on the tableDataKey, which seems to create an object navigational graph. > > Right. We already made that change. So what is the problem you are running into? data.group seems like it should work as a column name. It doesn't work because BeanAdapter tries to find the getterMethod for group in data (which is a Map) and it fails, since it is looking for "getData", when it should be looking for "get" with an argument of "data". It would require a couple of checks in the lines of if (Map.class.isAssignableFrom(beanClass)) to create a spesific getter method for Maps, and some other small stuff, but it could be implemented very cleanly without any performance hit. -- Edvin