From adffaces-user-return-2802-apmail-incubator-adffaces-user-archive=incubator.apache.org@incubator.apache.org Fri Apr 20 20:23:45 2007 Return-Path: Delivered-To: apmail-incubator-adffaces-user-archive@locus.apache.org Received: (qmail 69937 invoked from network); 20 Apr 2007 20:23:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Apr 2007 20:23:44 -0000 Received: (qmail 9153 invoked by uid 500); 20 Apr 2007 20:23:50 -0000 Delivered-To: apmail-incubator-adffaces-user-archive@incubator.apache.org Received: (qmail 9135 invoked by uid 500); 20 Apr 2007 20:23:50 -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 9126 invoked by uid 99); 20 Apr 2007 20:23:50 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Apr 2007 13:23:50 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [192.234.253.30] (HELO nemours.org) (192.234.253.30) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Apr 2007 13:23:43 -0700 Received: from nemapp38.nemours.org ([172.19.10.55]) by nemours.org with Microsoft SMTPSVC(5.0.2195.6713); Fri, 20 Apr 2007 16:24:49 -0400 Received: from 10.20.11.90 by nemapp38.nemours.org with ESMTP (SMTP Relay); Fri, 20 Apr 2007 16:23:52 -0400 X-Server-Uuid: 35EBC2B0-EA10-409F-9923-04DFACBAF8D2 Received: from jaxmsx02.nemours.org ([10.20.9.25]) by nemmsx01.nemours.org with Microsoft SMTPSVC(5.0.2195.6713); Fri, 20 Apr 2007 16:23:06 -0400 Content-class: urn:content-classes:message MIME-Version: 1.0 X-MimeOLE: Produced By Microsoft Exchange V6.5 Subject: RE: dataTable - loading data in a bean constructor Date: Fri, 20 Apr 2007 16:23:05 -0400 Message-ID: <2123A704743EB34295B4AA1DB09475680148403B@jaxmsx02.nemours.org> In-Reply-To: <254acf980704201243o3b1f9b45v13cd1c8d6b5786a4@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: dataTable - loading data in a bean constructor Thread-Index: AceDhGVYav1mRhiwRrWAWWI1I/0hIgABOcmg From: "Daniel King" To: adffaces-user@incubator.apache.org X-OriginalArrivalTime: 20 Apr 2007 20:23:06.0897 (UTC) FILETIME=[B4B69010:01C78389] X-WSS-ID: 6A37FED22D4124422-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Brightmail-Tracker: AAAAAQAAA+k= X-Language-Identified: TRUE X-Virus-Checked: Checked by ClamAV on apache.org Simon, Thanks for the response. This is for a shopping cart application with a huge number of possible clients. Also this table has the ability to paginate. The problem with your idea would be that the bean is request scope and gets constructed again when the table is paginated. This calls the method to fill the table from the constructor and the PPR method. And if I check to see that it is a PPR method and not load the data then it isn't loaded whenever it is within a subview for a tab. Daniel King, R2D2, C3P0 Application Engineer Web Team Nemours Office: (904) 288-5643 Fax: (904) 288-5758 =20 *** Call me Daniel *** NOTICE...This electronic transmission is intended only for the person(s) named. It may contain information that is (i) proprietary to the sender, and/or (ii) privileged, confidential and/or otherwise exempt from disclosure under applicable State and Federal law, including, but not limited to, privacy standards imposed pursuant to the federal Health Insurance Portability and Accountability Act of 1996 (HIPAA). Receipt by anyone other than the named recipient(s) is not a waiver of any applicable privilege. If you received this confidential communication in error, please notify the sender immediately by reply e-mail message and permanently delete the original message from your system. -----Original Message----- From: Simon Lessard [mailto:simon.lessard.3@gmail.com]=20 Sent: Friday, April 20, 2007 3:43 PM To: adffaces-user@incubator.apache.org Subject: Re: dataTable - loading data in a bean constructor Hello Daniel, What prevent you from using an instance variable initially set to null and load the data in the bean's get method only if the cached value is still null? Like: public class MyBean { private List loadedClients; public List getClients() { if (loadedClients =3D=3D null) { loadedClients =3D loadClients(); } return loadedClients; } } On 4/20/07, Daniel King wrote: > > Currently I am loading a data table's data in the constructor of my > bean. I can check to see when my bean is constructed if it is a > postback and if so skip this data load. > > > > However I have a situation where I have a subview which has a data table > that needs data loaded as soon as you hit the page. This postback check > will cause the data load to be skipped. > > > > Anyone else have a similar problem and solution where they need data > loaded as soon as a page loads and not on PPR? > > > > Postback check example: > > > > public MyBean() { > > if(!RequestContext.getCurrentInstance().isPostback()) { > > // load data > > } > > } > > > > Thanks, > > Daniel King, R2D2, C3P0 > > Application Engineer > > Web Team > > Nemours > > Office: (904) 288-5643 > > Fax: (904) 288-5758 > > > > *** Call me Daniel *** > > NOTICE...This electronic transmission is intended only for the person(s) > named. It may contain information that is (i) proprietary to the > sender, and/or (ii) privileged, confidential and/or otherwise exempt > from disclosure under applicable State and Federal law, including, but > not limited to, privacy standards imposed pursuant to the federal Health > Insurance Portability and Accountability Act of 1996 (HIPAA). Receipt > by anyone other than the named recipient(s) is not a waiver of any > applicable privilege. If you received this confidential communication > in error, please notify the sender immediately by reply e-mail message > and permanently delete the original message from your system. > > > >