Return-Path: Delivered-To: apmail-pivot-user-archive@www.apache.org Received: (qmail 34583 invoked from network); 10 Dec 2010 01:54:03 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 10 Dec 2010 01:54:03 -0000 Received: (qmail 86563 invoked by uid 500); 10 Dec 2010 01:54:03 -0000 Delivered-To: apmail-pivot-user-archive@pivot.apache.org Received: (qmail 86529 invoked by uid 500); 10 Dec 2010 01:54:02 -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 86521 invoked by uid 99); 10 Dec 2010 01:54:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Dec 2010 01:54:02 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [218.213.231.163] (HELO mail01.murata.com.hk) (218.213.231.163) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Dec 2010 01:53:53 +0000 Received: by mail01.murata.com.hk (Postfix, from userid 99) id 81F5329762D; Fri, 10 Dec 2010 09:53:28 +0800 (HKT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail01.murata.com.hk X-Spam-Level: Received: from mcfnotes1.mcf.murata.com (unknown [163.50.24.2]) by mail01.murata.com.hk (Postfix) with ESMTP id B93F3297622 for ; Fri, 10 Dec 2010 09:53:27 +0800 (HKT) In-Reply-To: To: user@pivot.apache.org Subject: Re: how to set large data using getquery and jsonserializer? MIME-Version: 1.0 X-Mailer: Lotus Notes Release 6.5.6 March 06, 2007 Message-ID: From: HeroLi@sz.murata.com.cn Date: Fri, 10 Dec 2010 09:53:12 +0800 X-MIMETrack: Serialize by Router on MCFNOTES1/CHN/MURATA_ASIA(Release 6.5.6FP3|March 27, 2008) at 12/10/2010 09:53:27 AM, Serialize complete at 12/10/2010 09:53:27 AM Content-Type: multipart/alternative; boundary="=_alternative 000A6321482577F5_=" X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-7.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, HTML_MESSAGE autolearn=ham version=3.2.5 This is a multipart message in MIME format. --=_alternative 000A6321482577F5_= Content-Type: text/plain; charset="US-ASCII" Thanks for your professional answer. I' ll try it again. Thanks and best regards Hero. Greg Brown 12/09/2010 09:13 PM Please respond to user@pivot.apache.org To user@pivot.apache.org cc Subject Re: how to set large data using getquery and jsonserializer? I'd like to build a demo following the large data set sample in Apache Pivot official web site . The sample is using CSVSerializer and calling a thead class [ AddRowsCallback] in method endList() and readitem(). Question: 1.Can any one demonstrate the 2 method of endList() and readItem()? The code at the beginning of this file is the best example of how to use these methods: http://svn.apache.org/repos/asf/pivot/trunk/demos/src/org/apache/pivot/demos/million/LargeData.java The execute() method opens a stream from the given URL and wraps it in a MonitoredInputStream. MonitoredInputStream is an inner class of IOTask that will respect the abort flag if it is set by the caller. It then reads the data from the input stream using CSVSerializer. CSVSerializer fires 3 events: beginList() -- called when the list is created endList() -- called after the last item has been read readItem() -- called after each item is read In this example, the listener implementation builds up pages of results before adding them to the table view, since this will generally perform better for a large number of rows. The add is done in a callback so the UI does not get bogged down. 2.if using JSONSerializer and accept ArrayList parameter.do i still have to overwrite endList() and readItem()?I tried but it seams wrong. If you are reading JSON data, you will probably want to implement endList() and endDictionary() (assuming that your items are stored as JSON objects). endDictionary() will be called for each "row" in your data set. I just want to set ArrayList into tableview.As when the list'length is over about 500 hundreds,UI becomes frozen a few minutes. Yes, that is why we use the callback with the listeners. Make sure that you are calling the asynchronous version of Task#execute() (the one that takes a TaskListener). The synchronous one won't do you much good, since you'll be executing the actual query on the UI thread and it won't get any updates until the task is done. --=_alternative 000A6321482577F5_= Content-Type: text/html; charset="US-ASCII"
Thanks for your professional answer.

I' ll try it again.

Thanks and best regards

Hero.


Greg Brown <gk_brown@verizon.net>

12/09/2010 09:13 PM
Please respond to
user@pivot.apache.org

To
user@pivot.apache.org
cc
Subject
Re: how to set large data using getquery and jsonserializer?





        I'd like to build a demo following the large data set sample in Apache Pivot official web site .

       The sample is using
CSVSerializer and calling a thead class [AddRowsCallback] in method endList() and readitem().

Question:

       1.Can any one demonstrate the 2 method of  endList() and readItem()?


The code at the beginning of this file is the best example of how to use these methods:

http://svn.apache.org/repos/asf/pivot/trunk/demos/src/org/apache/pivot/demos/million/LargeData.java

The execute() method opens a stream from the given URL and wraps it in a MonitoredInputStream. MonitoredInputStream is an inner class of IOTask that will respect the abort flag if it is set by the caller.

It then reads the data from the input stream using CSVSerializer. CSVSerializer fires 3 events:

beginList() -- called when the list is created
endList() -- called after the last item has been read
readItem() -- called after each item is read

In this example, the listener implementation builds up pages of results before adding them to the table view, since this will generally perform better for a large number of rows. The add is done in a callback so the UI does not get bogged down.

        2.if using JSONSerializer and accept  ArrayList parameter.do i still have to overwrite endList() and readItem()?I tried
     but it seams wrong.


If you are reading JSON data, you will probably want to implement endList() and endDictionary() (assuming that your items are stored as JSON objects). endDictionary() will be called for each "row" in your data set.

I just want to set ArrayList  into tableview.As when the list'length is over about 500 hundreds,UI becomes
frozen a few minutes.


Yes, that is why we use the callback with the listeners. Make sure that you are calling the asynchronous version of Task#execute() (the one that takes a TaskListener). The synchronous one won't do you much good, since you'll be executing the actual query on the UI thread and it won't get any updates until the task is done.


--=_alternative 000A6321482577F5_=--