Re: Add massive data into a Grid or FlexTable

2010-01-27 Thread JohnnyGWT
Did you try using an IncrementalCommand to break up the process of
adding rows?

On Jan 6, 7:49 pm, 郑翼羽 ground...@gmail.com wrote:
 Hi, I need to construct a table likegridwith massive data, for
 example 100 * 60.

 The code I used is dataGrid.setText(i, j, value), so I need to call it
 6000 times, and the value varied from null data to strings with
 unfixed length.

 It took nearly 4 seconds to displaygrid, regardless of the data transfer time.

                                 Date d3 = new Date();
                                 for (int i = 0; i  result.length; i++) {
                                         String[] rowValues = result[i];       
                          
                                         for (int j = 0; j rowValues.length; 
 j++) {
                                                 String value = rowValues[j];
                                                 if (value != null) {
                                                         dataGrid.setText(i, 
 j, value);
                                                 }
                                         }
                                 }

                                 d2 = new Date();
                                 l.setText((d2.getTime() - d1.getTime()) / 
 1000.0 + _ +
 (d2.getTime() - d3.getTime()) / 1000.0 + );

 Is there any other method to speed up these action such as add a row
 in one time?

 Anyone could help me, or point out whether my codes have some problems?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Add massive data into a Grid or FlexTable

2010-01-08 Thread 郑翼羽
I have fixed it , it is my fault , because I always works under dev
model while I switch to web model , the time is below 0.5 second now.



On Thu, Jan 7, 2010 at 9:49 AM, 郑翼羽 ground...@gmail.com wrote:
 Hi, I need to construct a table like grid with massive data, for
 example 100 * 60.

 The code I used is dataGrid.setText(i, j, value), so I need to call it
 6000 times, and the value varied from null data to strings with
 unfixed length.

 It took nearly 4 seconds to display grid, regardless of the data transfer 
 time.

                                Date d3 = new Date();
                                for (int i = 0; i  result.length; i++) {
                                        String[] rowValues = result[i];
                                        for (int j = 0; j rowValues.length; 
 j++) {
                                                String value = rowValues[j];
                                                if (value != null) {
                                                        dataGrid.setText(i, j, 
 value);
                                                }
                                        }
                                }

                                d2 = new Date();
                                l.setText((d2.getTime() - d1.getTime()) / 
 1000.0 + _ +
 (d2.getTime() - d3.getTime()) / 1000.0 + );


 Is there any other method to speed up these action such as add a row
 in one time?

 Anyone could help me, or point out whether my codes have some problems?




-- 
郑翼羽

Nari Info
Nju

13813068756
-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.




Add massive data into a Grid or FlexTable

2010-01-08 Thread 郑翼羽
Hi, I need to construct a table like grid with massive data, for
example 100 * 60.

The code I used is dataGrid.setText(i, j, value), so I need to call it
6000 times, and the value varied from null data to strings with
unfixed length.

It took nearly 4 seconds to display grid, regardless of the data transfer time.

Date d3 = new Date();
for (int i = 0; i  result.length; i++) {
String[] rowValues = result[i]; 

for (int j = 0; j rowValues.length; 
j++) {
String value = rowValues[j];
if (value != null) {
dataGrid.setText(i, j, 
value);
}
}
}

d2 = new Date();
l.setText((d2.getTime() - d1.getTime()) / 
1000.0 + _ +
(d2.getTime() - d3.getTime()) / 1000.0 + );


Is there any other method to speed up these action such as add a row
in one time?

Anyone could help me, or point out whether my codes have some problems?
-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.