cancel
Showing results for 
Search instead for 
Did you mean: 

Graph is not getting refreshed

Former Member
0 Kudos

Hi Experts,

I have used business graphics to graphically display some data. I have created two buttons. One button shows graph of "present week". The other button displays the data of "next week". When I am clicking on "present week" graphs are getting populated correctly. However, when I am clicking on "next week" the graphs are getting populated incorrectly. As per the business functionality one has to compulsorily press "present week" button first. Only after that one has to click on "next week". On clicking on "next week", Web Dynpro pictorially displays data of both "present week" and "next week". I am wondering what is going wrong here. I tried various methods to get rid of data of "present week" while clicking on "next week". However, I am not getting success. It seems that data of "present week" is not getting deleted due to some reason when I am clicking on "next week". I tried using "invalidate" by using following statement:

wdContext.nodeWorklist().invalidate();

It is not working.

Code of "present week" is as below:

IPrivateTimesheetView.ICategoriesElement categoryElement;

IPrivateTimesheetView.ICategories_1Element category_1Element;

String wbs ="h";

double d =0;

double d1 =0;

double sum = 0;

String sum_hrs ="";

double sumValue = 0;

for (int i=0 ; i<wdContext.nodeWorklist().size() ; i++){

wdContext.nodeWorklist().setLeadSelection(i);

categoryElement = wdContext.createCategoriesElement();

double finalSum =0.0;

wbs = wdContext.currentWorklistElement().getReciever_Wbs_Element();

sum_hrs = wdContext.currentWorklistElement().getSum_Hours();

sum_hrs = sum_hrs.replaceAll(",",".");

if( sum_hrs != null && sum_hrs.trim().length()>0)

d = Double.parseDouble(sum_hrs) ;

finalSum=finalSum+d;

sumValue = sumValue + d;

categoryElement.setCategoryText(wbs);

categoryElement.setSeries1Value(d);

wdContext.nodeCategories().addElement(categoryElement);

wbs = "";

}

category_1Element = wdContext.createCategories_1Element();

category_1Element.setCategoryText("Total No of hours entered for all WBSs by you");

category_1Element.setSeries1Value(sumValue);

wdContext.nodeCategories_1().addElement(category_1Element);

Code of "next week" is as follows:

IPrivateTimesheetView.ICategoriesElement categoryElement;

IPrivateTimesheetView.ICategories_1Element category_1Element;

String wbs ="h";

double d =0;

double d1 =0;

double sum = 0;

String sum_hrs ="";

double sumValue = 0;

for (int i=0 ; i<wdContext.nodeWorklist().size() ; i++){

wdContext.nodeWorklist().setLeadSelection(i);

categoryElement = wdContext.createCategoriesElement();

double finalSum =0.0;

wbs = wdContext.currentWorklistElement().getReciever_Wbs_Element();

sum_hrs = wdContext.currentWorklistElement().getSum_Hours();

sum_hrs = sum_hrs.replaceAll(",",".");

if( sum_hrs != null && sum_hrs.trim().length()>0)

d = Double.parseDouble(sum_hrs) ;

finalSum=finalSum+d;

sumValue = sumValue + d;

categoryElement.setCategoryText("");

categoryElement.setSeries1Value(0);

categoryElement.setCategoryText(wbs);

categoryElement.setSeries1Value(d);

wdContext.nodeCategories().addElement(categoryElement);

wbs = "";

}

category_1Element = wdContext.createCategories_1Element();

category_1Element.setCategoryText("");

category_1Element.setSeries1Value(0);

category_1Element.setSeries2Value(0);

category_1Element.setCategoryText("Total No of hours entered for all WBSs by you");

category_1Element.setSeries1Value(sumValue);

wdContext.nodeCategories_1().addElement(category_1Element);

Can you please help me?

Regards,

S

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

wdContext.nodeCategories().invalidate() and wdContext.nodeCategories_1().invalidate() in the begining of "next week" code.

Former Member
0 Kudos

Thank Maksim,

The issue has got sorted out. Full credit to you.

Have a very nice week ahead.

Regards,

S

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Experts,

Further to above question, please note that I have created table to display the data of "present week" and "next week". Using the program, the table is getting populated correctly in both cases - "present week" and "next week". Only graph is still showing details of both - "present week" and "next week" taken together. I tried to sort out the issue using "wdContext.nodeWorklist().clearSelection();" statement as well. However it is still not helping. Can you please help me.

Thanks

S