0

ProgressMeter with busy tag

asked 2016-11-24 10:38:23 +0800

Vijay3947861 gravatar image Vijay3947861
1

1 down vote favorite 1

I am using ZK framework. I just want to insert lots of rows into my MySQL database. While inserting data it takes few seconds. During that time I just want to show a progress meter, which tells user about the number of rows inserted into the database.

I tried like this:

rowCount = qModel.executeInsert();
for(long j = 1; j <= rowCount; j++) { sum = sum + 100 / rowCount; if (j == rowCount) {
sum = 100; }
progressMeter.setValue(sum);
countLabel.setValue((rowCount - 1) + " Rows inserted"); BindUtils.postNotifyChange(null, null, countLabel, "_value"); }

Here rowCount is the total number of rows inserted into the database. I know after the inserting process the progress meter is getting updated. But i want my progress meter updated with no busy tag.

If anyone knows the solution, help me out. All suggestions are welcome. Thanks in advance.

delete flag offensive retag edit

4 Answers

Sort by ยป oldest newest most voted
0

answered 2016-11-25 07:54:29 +0800

hubin gravatar image hubin
24 1

One row insert at one time(maybe lower efficiency),evertime insert success,update progressMeter's label.

link publish delete flag offensive edit
0

answered 2016-11-26 08:50:50 +0800

Darksu gravatar image Darksu
1991 1 4

Hello hubin,

I have done a similar task using long operations:

https://www.zkoss.org/wiki/SmallTalks/2015/January/SimplifyLongOperationHandlings

Best Regards,

Darksu

link publish delete flag offensive edit
0

answered 2016-11-28 01:38:21 +0800

hubin gravatar image hubin
24 1

Hello Darksu, There is nothing in that page.

link publish delete flag offensive edit
0

answered 2016-11-28 07:57:05 +0800

Darksu gravatar image Darksu
1991 1 4

Hello hubin,

I checked the link regarding long operation handling and it is working.

Do you need more help or further explanation?

Best Regards,

Darksu

link publish delete flag offensive edit

Comments

It's working,thanks. Nice example.

hubin ( 2016-11-28 08:18:13 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2016-11-24 10:38:23 +0800

Seen: 34 times

Last updated: Nov 28 '16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More