cancel
Showing results for 
Search instead for 
Did you mean: 

Progress Indicator usage, examples....

Former Member
0 Kudos

Hello All,

I was messing around with the progress indicator UI. It seems as if I can't get it to behave how I want.

In my example, I am loading some records into the context. (The backend call has already been made and everything is sitting in the cache). The rfc call retrieves some 50,000 records. I am loading 100 at a time into my context everytime the user clicks a button. In the loop that loads the 100 records I've got the following:


int progress = 0;
for ( int i=0; i<100; i++ )
{
    SomeElement el = nodeRFCNode().getSomeElementAt(i);
    CustomElement cusEl = customElementNode.createCustomElement();
    cusEl.setVar( el.getVar() );
    customElementNode.add( cusEl );
    progress++;
    wdContext.currentContextElement().setProgress(progress);
}

Progress is an integer value attribute that is bound to the percentValue property of the Progress Indicator UI element.

Now what I expected to see was the progress indicator increase by 1% every loop iteration. But instead what I saw was the entire progress indicator full after the loop had run its entire course!! That ofcourse is of no value. Can someone help me understand and achieve the result that I expected to see please??

Kind regards,

Marshall.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I have come to the conclusion that the progressindicator will never function as desired in this version of NWDS (7.0.18).

Former Member
0 Kudos

Try setting delay in between that so you will get to know if the Progress Indicator UI is working as expected. Probably the loop is finishing too fast.

Can you make use of timedtrigger element?

http://help.sap.com/saphelp_nw70/helpdata/en/da/a6884121a41c09e10000000a155106/frameset.htm

Former Member
0 Kudos

Hi,

Thanks for the replies....

Here is how I have implemented TimedTrigger


int progress = 0;
wdContext.currentContextElement().setTrigger(true);
for ( int i=0; i<100; i++ )
{
    SomeElement el = nodeRFCNode().getSomeElementAt(i);
    CustomElement cusEl = customElementNode.createCustomElement();
    cusEl.setVar( el.getVar() );
    customElementNode.add( cusEl );
    progress++;
    wdContext.currentContextElement().setProgress(progress);
}
wdContext.currentContextElement().setTrigger(false);

I have created a context value attribute of type boolean called trigger and bound it to the enabled property of the timed trigger. I've set the delat property to 1 and have an onAction event called UpdateProgress. Inside the action I just increment the percentage value of the progress bar. The loop takes approx 8 secs to run, so I know it doesn't finish too quickly.

However, the progress bar is still not responding as expected. I don't think the TimedTrigger event ever fires. Even when enabled is set to true.

Any other suggestions please?

M

Former Member
0 Kudos

Hello Marshall,

Did you set the UpdateProgress event to the onAction Event Property of the TimedTrigger UI Element....?

Regards,

Shikhil

Former Member
0 Kudos

Yes, I've triple checked all the obvious

Former Member
0 Kudos

Did you bind the context attribute used to increase the percent value to the Percent value property of the Progress Indicator....

Regards,

Shikhil

Former Member
0 Kudos

Like I said, I've triple checked all the obvious.

Former Member
0 Kudos

Hi Marshall,

What I cann guess is that the code is working fine and the UI element is also behaving as you expected but the problem may be that the time taken by the loop might be so less that when the UI element gets loaded on the screen till then the code gets executed completely.

You can check that by changing the termination condition of the for loop, i.e. ,


for ( int i=0; i<100; i++ )
as
for ( int i=0; i<50; i++ )

Regards.

Rajat