Question about plugging in an ajax progress bar component onto a black-box.

Hello,

I have the following problem: I want to integrate an ajax progress bar component to a j2ee application and I am in reference to the following pattern (https://bpcatalog.dev.java.net/nonav/ajax/progress-bar/design.html). It seems I need for the "task" component to return the percent. The problem I have is that I am calling a legacy method (i.e. as400) that does not return a percent as it is to me only a black-box. Here is a snippet of what it looks like to me:

AS400 sys =new AS400("AS400D.calyonfinancial.com");

sys.setUserId("jmartin");

sys.setPassword("jmartin");

CommandCall cmd =new CommandCall(sys);

cmd.run("my as400 command goes here");

AS400Message[] messageList = cmd.getMessageList();

for (AS400Message msg : messageList){

System.out.println(msg.getText());

}

sys.disconnectService(AS400.COMMAND);

At best I can know whether or not it is completed.

void actionCompleted(ActionCompletedEvent event)//Invoked when an action has completed.

What do you advise I do bearing in mind I want to avoid using an indeterminate progress bar?

Thanks in advance,

Julien Martin.

[1508 byte] By [balteoa] at [2007-11-26 14:26:22]
# 1

That's not a legacy method. The latest version of JTOpen was issued less than a month ago. And note that it's open-source, so you could change it yourself to provide percent-complete data. (Of course you'd have to be able to get that data from the underlying iSeries command.)

It wouldn't be easy, but if you think about it for a minute you'll realize that you can't display percentage complete in a progress bar unless you have some way of finding out what percentage the task has actually completed.

DrClapa at 2007-7-8 2:19:34 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
yes your right... my question was a bit dumb... sorry about that.
balteoa at 2007-7-8 2:19:34 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...