Hi,
I am trying to implement utility class(Calculating total for 1 column) in my application.
I have 2 views and one custom controller.
1) TableUtilities.java class imported to src/packages.
2) Created a value attribute say tableutility in ResultView Context ,and assigned the properties of the attribute type Java Native Type "TableUtilities".
Do I need to create anything other than this?.
Below code is added to the ResultView wdDoModifyView
-
if(firstTime) {
IWDTextView tv = (IWDTextView)view.getElement("total");
wdContext.currentContextElement().setTableutility(new TableUtilities(wdContext.nodeDepartments()));
//Returns attribute info of a dynamically created attribute which can be bound to the UI element need.
tv.bindText(wdContext.currentContextElement().getTableutility().CalculateSum("Departments","NoOfPeople"));
}
If I implement this code in my Resultview wdDoModifyView, it is throwing run time errors.........
.at sd.salesorderslist.SalesResultView.wdDoModifyView(SalesResultView.java:146)
at sd.salesorderslist.wdp.InternalSalesResultView.wdDoModifyView(InternalSalesResultView.java:301)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)
at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:337)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:481)
Please advice.