Return-Path: Delivered-To: apmail-incubator-pivot-user-archive@minotaur.apache.org Received: (qmail 33914 invoked from network); 14 Sep 2009 23:32:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Sep 2009 23:32:28 -0000 Received: (qmail 25861 invoked by uid 500); 14 Sep 2009 23:32:28 -0000 Delivered-To: apmail-incubator-pivot-user-archive@incubator.apache.org Received: (qmail 25819 invoked by uid 500); 14 Sep 2009 23:32:28 -0000 Mailing-List: contact pivot-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: pivot-user@incubator.apache.org Delivered-To: mailing list pivot-user@incubator.apache.org Received: (qmail 25810 invoked by uid 99); 14 Sep 2009 23:32:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Sep 2009 23:32:28 +0000 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gkbrown@mac.com designates 17.148.16.98 as permitted sender) Received: from [17.148.16.98] (HELO asmtpout023.mac.com) (17.148.16.98) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Sep 2009 23:32:17 +0000 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii; format=flowed; delsp=yes Received: from laptop.home (pool-173-76-179-124.bstnma.fios.verizon.net [173.76.179.124]) by asmtp023.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KPZ009V7IITZI10@asmtp023.mac.com> for pivot-user@incubator.apache.org; Mon, 14 Sep 2009 16:28:08 -0700 (PDT) Subject: Re: TableViewRowEditor and New Records From: Greg Brown In-reply-to: <200909150924.24054.lists@sael.com.au> Date: Mon, 14 Sep 2009 19:28:05 -0400 Message-id: <32D50CF2-45E7-4B23-AB66-AE0760BEFC3F@mac.com> References: <200909141122.31605.lists@sael.com.au> <200909150814.24808.lists@sael.com.au> <9F1181CC-B79D-4E42-A130-43743C984576@mac.com> <200909150924.24054.lists@sael.com.au> To: pivot-user@incubator.apache.org X-Mailer: Apple Mail (2.1075.2) X-Virus-Checked: Checked by ClamAV on apache.org It is specified by the "compiler.debug" property in the build script. You can modify the script directly, but I think there is also a way to override the value via the command line (not sure of the syntax, though). On Sep 14, 2009, at 7:24 PM, Scott Lanham wrote: > Which ant target turns debug info on? > > On Tue, 15 Sep 2009 08:48:36 am Greg Brown wrote: >> Hi Scott, >> >> Just wondering what specifically you needed to modify in ListButton >> to >> accept a -1 value? -1 should already have been a valid value for >> setSelectedIndex() - were you finding otherwise? >> >> Would it be possible for you to build Pivot with debug info turned >> on? >> That way we can see specific line numbers when error like this occur. >> >> Thanks, >> Greg >> >> On Sep 14, 2009, at 6:14 PM, Scott Lanham wrote: >>> I have modified ListButton to simply accept -1 as a valid index and >>> everything >>> works great on that front. But there is another problem. If a new >>> row is added >>> to the TableView via the associated Dictionary and the >>> TablieViewRowEditor is >>> immediately invoked on that new row the error below occurs: >>> >>> Exception in thread "AWT-EventQueue-0" >>> java.lang.IndexOutOfBoundsException >>> at org.apache.pivot.collections.ArrayList.get(Unknown Source) >>> at org.apache.pivot.wtk.Container.validate(Unknown Source) >>> at org.apache.pivot.wtk.Display$ValidateCallback.run(Unknown >>> Source) >>> at java.awt.event.InvocationEvent.dispatch >>> (InvocationEvent.java:209) >>> at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) >>> at >>> java.awt.EventDispatchThread.pumpOneEventForFilters >>> (EventDispatchThread.java:269) >>> at >>> java.awt.EventDispatchThread.pumpEventsForFilter >>> (EventDispatchThread.java:184) >>> at >>> java.awt.EventDispatchThread.pumpEventsForHierarchy >>> (EventDispatchThread.java:174) >>> at >>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java: >>> 169) >>> at >>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java: >>> 161) >>> at java.awt.EventDispatchThread.run(EventDispatchThread.java: >>> 122) >>> Exception in thread "AWT-EventQueue-0" >>> java.lang.NullPointerException >>> at >>> org.apache.pivot.wtk.content.TableViewRowEditor >>> $2$1.selectedIndexChanged(Unknown >>> Source) >>> at >>> org.apache.pivot.wtk.CardPane >>> $CardPaneListenerList.selectedIndexChanged(Unknown >>> Source) >>> at org.apache.pivot.wtk.CardPane.setSelectedIndex(Unknown >>> Source) >>> at >>> org.apache.pivot.wtk.skin.CardPaneSkin$1.transitionCompleted(Unknown >>> Source) >>> at org.apache.pivot.wtk.effects.Transition$1.run(Unknown >>> Source) >>> at >>> org.apache.pivot.wtk.ApplicationContext$ScheduledCallback$1.run >>> (Unknown >>> Source) >>> at java.awt.event.InvocationEvent.dispatch >>> (InvocationEvent.java:209) >>> at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) >>> at >>> java.awt.EventDispatchThread.pumpOneEventForFilters >>> (EventDispatchThread.java:269) >>> at >>> java.awt.EventDispatchThread.pumpEventsForFilter >>> (EventDispatchThread.java:184) >>> at >>> java.awt.EventDispatchThread.pumpEventsForHierarchy >>> (EventDispatchThread.java:174) >>> at >>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java: >>> 169) >>> at >>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java: >>> 161) >>> at java.awt.EventDispatchThread.run(EventDispatchThread.java: >>> 122) >>> >>> On Mon, 14 Sep 2009 09:07:18 pm Todd Volkert wrote: >>>> The update I made to ListButton should be preventing that case - >>>> did you >>>> make sure to rebuild the Pivot jars? >>>> >>>> public void setSelectedItem(Object item) { >>>> int index = -1; >>>> >>>> if (item != null) { >>>> index = ((List)listData).indexOf(item); >>>> if (index == -1) { >>>> throw new IllegalArgumentException("\"" + item + "\" >>>> is not >>>> a valid selection."); >>>> } >>>> } >>>> >>>> setSelectedIndex(index); >>>> } >>>> >>>> If you're getting ["null" is not a valid selection.] with the above >>>> code, >>>> then it means that your bind context has the actual String, "null", >>>> as the >>>> value to load... >>>> >>>> -T >>>> >>>> On Mon, Sep 14, 2009 at 12:20 AM, Scott Lanham >>>> >>>> wrote: >>>>> Digging a little deeper the ListButton is asking its list data, a >>>>> custom >>>>> Dictionary, which index the "null" item belongs to. As the list >>>>> data >>>>> doesn't >>>>> have a null item, my Dictionary replies -1. >>>>> >>>>> On Mon, 14 Sep 2009 01:58:32 pm Scott Lanham wrote: >>>>>> Okay, made sure SVN is up to date and no blonde moment occuring >>>>>> ( much >>>>>> ). >>>>>> >>>>>> What I get now is: >>>>>> >>>>>> java.lang.IllegalArgumentException: "null" is not a valid >>>>>> selection. >>>>>> at org.apache.pivot.wtk.ListButton.setSelectedItem(Unknown >>>>> >>>>> Source) >>>>> >>>>>> at org.apache.pivot.wtk.ListButton.load(Unknown Source) >>>>>> at org.apache.pivot.wtk.Container.load(Unknown Source) >>>>>> at org.apache.pivot.wtk.content.TableViewRowEditor.edit >>>>>> (Unknown >>>>>> Source) >>>>>> >>>>>> On Mon, 14 Sep 2009 11:51:59 am Todd Volkert wrote: >>>>>>> One problem stems from the fact that ListButton.setSelectedItem >>>>>>> (null) >>>>> >>>>> was >>>>> >>>>>>> explicitly throwing IllegalArgumentException, when it probably >>>>>>> should >>>>>>> have been translating to setSelectedIndex(-1). I just checked >>>>>>> in a >>>>>>> fix for this, so that might fix you up. >>>>>>> >>>>>>> So you're creating blank rows, and immediately opening an editor >>>>>>> on >>>>>>> the row for the user to populate it with initial values? >>>>>>> >>>>>>> Let me know if that check-in fixes the issue. >>>>>>> >>>>>>> -T >>>>>>> >>>>>>> On Sun, Sep 13, 2009 at 9:22 PM, Scott Lanham >>>>>>> >>>>> >>>>> wrote: >>>>>>>> Howdy Hi, >>>>>>>> >>>>>>>> I have a TableView which displays data from a database table. >>>>>>>> That >>>>> >>>>> data >>>>> >>>>>>>> is bound to the TableView using a custom Dictionary. It all >>>>>>>> works >>>>> >>>>> fine >>>>> >>>>>>>> until it is >>>>>>>> time to add a new record using the TableView and in place >>>>>>>> editing >>>>>>>> it using TableViewRowEditor. Several of the fields in a >>>>>>>> TableView >>>>>>>> row >>>>> >>>>> have >>>>> >>>>>>>> ListButtons >>>>>>>> assocated with them to restrict the field values. When the >>>>>>>> field >>>>> >>>>> value >>>>> >>>>>>>> is initially Null, as with a new record, the ListButtons don't >>>>>>>> like >>>>> >>>>> it >>>>> >>>>>>>> because Null can't be found in the lists data. >>>>>>>> >>>>>>>> Is there any way I can get ListButton to not throw an exception >>>>>>>> in >>>>> >>>>> this >>>>> >>>>>>>> case? >>>>>>>> >>>>>>>> Thanks, >>>>>>>> >>>>>>>> Scott. >