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