cancel
Showing results for 
Search instead for 
Did you mean: 

ProgressIndicator...

david_fryda2
Participant
0 Kudos

Hi everyone,

I am trying to get work to ProgressIndicator but without success.

Lets that I have this code.

public void wdDoInit()

{

//@@begin wdDoInit()

for(int i=0;i<1000;i++)

wdContext.currentContextElement().setText(Integer.toString(i));

//@@end

}

I created an attribut value "text".

Now I want to connect the ProgressIndicator to this loop process.

Is it possible.... ?

Thanks a lot!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi David,

Progressndicator value is smth. static rather then dynamic -- it does not update itself within single Request / Response cycle.

If you need dynamic behavior, then (use on your own risk, this is not recommended aproach for J2EE / Web applications)

1. Fork separate thread to process time-consuming work.

2. Make this thread update some context variable that reflects progress.

3. In WD View use Timer UI control to periodically check progress (you have to define at least empty onTimer action and resanoble delay in seconds)

VS

david_fryda2
Participant
0 Kudos

Hi,

Thanks for the fast replies.

I think I missunderstood something.

I wrote in my handler.

public void onActionProgress(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionProgress(ServerEvent)

for(int i=0;i<30;i++) {

wdContext.currentContextElement().setProgress(i);

wdContext.currentContextElement().setText(Integer.toString(i));

}

//@@end

}

My internet browser seems to call the server in an infinit loop....But I do see the progress bar going till 29 pourcent.

Did I do something wrong in here....

former_member182372
Active Contributor
0 Kudos

Hi,

but if you put this in onAction event handler it is expected.... this method is called every "delay" time. So, it is called first time. You set to 0..29. 29 is final value when you leave event handler method. Then it is called again - 0..29, and again, and again. you can bind property of delay (TimedTrigger UI component) to context atribute and set it to 0 when process is finished (... A delay of 0 seconds means that the timer is turned off and no action is executed ... from help).

regards, Maxim r.

david_fryda2
Participant
0 Kudos

Thanks a lot guys...your help is precious!

Answers (2)

Answers (2)

former_member182372
Active Contributor
0 Kudos

Hi,

1) create "progress" attribute in context as integer

2) put on view TimedTrigger UI element. set delay as 1. specify onAction event handler.

3) put on view ProgressIndicator. bind percentValue to "progress" attribute.

4) in onAction event handler increment "progress" context attribute.

regrads, Maxim R

Former Member
0 Kudos

Hi David

Use the Pecentvalue property of the progress indicator.

create a context variabe and assign it to the percentvalue property and test it.

Let me know if you require any other help.

Kishore