From adffaces-user-return-1442-apmail-incubator-adffaces-user-archive=incubator.apache.org@incubator.apache.org Wed Nov 22 19:38:15 2006 Return-Path: Delivered-To: apmail-incubator-adffaces-user-archive@locus.apache.org Received: (qmail 19848 invoked from network); 22 Nov 2006 19:38:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Nov 2006 19:38:14 -0000 Received: (qmail 16001 invoked by uid 500); 22 Nov 2006 19:38:24 -0000 Delivered-To: apmail-incubator-adffaces-user-archive@incubator.apache.org Received: (qmail 15823 invoked by uid 500); 22 Nov 2006 19:38:23 -0000 Mailing-List: contact adffaces-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: adffaces-user@incubator.apache.org Delivered-To: mailing list adffaces-user@incubator.apache.org Received: (qmail 15814 invoked by uid 99); 22 Nov 2006 19:38:23 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Nov 2006 11:38:23 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of sabina.albu@gmail.com designates 64.233.182.186 as permitted sender) Received: from [64.233.182.186] (HELO nf-out-0910.google.com) (64.233.182.186) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Nov 2006 11:38:10 -0800 Received: by nf-out-0910.google.com with SMTP id a4so644286nfc for ; Wed, 22 Nov 2006 11:37:48 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=GZgPLhBit505fCDJESZcbs3h3AM53r/lCQSFWNgqsUjMoZKMuFOOktj5UK1XKPzpmN7uT49alvuTh2amp/loUpYJgmX9unGoqNJA9DU+gbHTRNYhnQWLBuNio/srt7KP7gigMF55JV6DZFC7ER11RvYAOg+VJirhMVcfP+YVkuk= Received: by 10.49.7.10 with SMTP id k10mr3160574nfi.1164224268531; Wed, 22 Nov 2006 11:37:48 -0800 (PST) Received: by 10.48.202.9 with HTTP; Wed, 22 Nov 2006 11:37:48 -0800 (PST) Message-ID: Date: Wed, 22 Nov 2006 14:37:48 -0500 From: "Sabina Albu" To: adffaces-user@incubator.apache.org Subject: Dynamic tr:table(rows) IndexOutOfBoundsException MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_42637_31810274.1164224268496" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_42637_31810274.1164224268496 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I am getting an java.lang.IndexOutOfBoundsException when I change the content/rows in the underlying model/list of a Trinidad table. The number of rows in my table changes upon clicking on a button: In XHTML: ... ... ... ... In backing bean: private java.util.List persons; ... public void reloadTable() { persons = null; persons = getPersons();//DB call to get new List of persons } In the initial load getPersons() returns 1 row. After a reload I get 3 rows and that's when I get the exception: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at java.util.ArrayList.RangeCheck(ArrayList.java:547) at java.util.ArrayList.get(ArrayList.java:322) at org.apache.myfaces.trinidad.component.StampState.restoreChildStampState ( StampState.java:152) at org.apache.myfaces.trinidad.component.UIXTable.restoreStampState( UIXTable.java:320) at org.apache.myfaces.trinidad.component.UIXCollection._restoreStampState( UIXCollection.java :1088) at org.apache.myfaces.trinidad.component.UIXCollection.postRowDataChange( UIXCollection.java:690) at org.apache.myfaces.trinidad.component.UIXCollection.setRowIndex( UIXCollection.java:406) at org.apache.myfaces.trinidad.component.UIXTable._processStamps( UIXTable.java:395) at org.apache.myfaces.trinidad.component.UIXTable.processFacetsAndChildren( UIXTable.java:268) at org.apache.myfaces.trinidad.component.UIXCollection.decodeChildrenImpl ( UIXCollection.java:159) at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren( UIXComponentBase.java:874) at org.apache.myfaces.trinidad.component.UIXCollection.processDecodes( UIXCollection.java :153) at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl( UIXComponentBase.java:889) at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren( UIXComponentBase.java :874) at org.apache.myfaces.trinidad.component.UIXForm.processDecodes( UIXForm.java:60) at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl( UIXComponentBase.java:889) at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren( UIXComponentBase.java:874) at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes( UIXComponentBase.java:725) at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl( UIXComponentBase.java:889) at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren( UIXComponentBase.java:874) at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes( UIXComponentBase.java:725) at javax.faces.component.UIComponentBase.processDecodes( UIComponentBase.java:872) at javax.faces.component.UIViewRoot.processDecodes (UIViewRoot.java :306) ..... What I found out until now is that the row index is set, at some point, to the wrong value(-1). Also in the sources from Trinidad in org.apache.myfaces.trinidad.component.UIXComponent I found this comment in the getRowKey() method: // See bug 4534104. // Sometimes the rowKey for a particular row changes during update model // (this happens in ADFM if you edit the primary key of a row). // It is bad if the rowKey changes after _restoreStampState() and // before _saveStampState(). Therefore, we cache it:.. I know that coding the new lines from within the bean is an option but I would like to keep the tags. It's easier to do table formatting and styling. Any advise is welcomed. Thanks, Sabina ------=_Part_42637_31810274.1164224268496--