Hi All,
I have created the custom component,in this custom component behavior class i wrote on of the method ,to get "the total results count " to display the
the count on the datagrid,on top of the pagenation.
For example : After clicking the execute button on the dql editor,the query will be executed and will give query results.Here total results will be displayed in the pagenation(No of pages).Here the problem is.if the query gives 95 results ,it will shows 10 pages.hence i implemented this functionaly.
Here my custom functionality is working fine.but the problem is ,after lunching the component from webtop and clicking the execute button.first time(if we execute the query, result is getting but it's not showing count at the custom label level.) it's not giving count but here i wrote sysout in code,in the sysout total records count is displayed.but it's not displaying on the webtop datagrid.. but it's giving total count from second time execution onwards.
suppose if run the same query,second time the then total count is displaying at the custom label.(total count).
The below is the code i am using.(environment 6.5 sp2)
TableResultSet resultSet = new TableResultSet(data, displayName);
datagrid.getDataProvider().setScrollableResultSet(resultSet);
datagrid.getDataProvider().refresh(resultSet);
datagrid.getDataProvider().initBind();
datagrid.getDataProvider().setCurrentPage(0);
int totalRecords = datagrid.getDataProvider().getResultsCount();
Label totalResutls = (Label) this.getControl("total_count",
com.documentum.web.form.control.Label.class);
totalResutls.setLabel("Total Records: "+totalRecords);
System.out.println("Total Records:"+totalRecords);
Please give your suggestions ,How to correct this misbahaviour.
Thanks
Hari.