Dear all,
I got a big problem and didn't know where there was wrong design in my code.
All I want to do is Query Functionality, that is to filter records of ListGrid by a given criteria which is from DynamicForm after fetching data from server-side. But it seems to fetch data from server-side only, not filtering records by a given criteria at all.
My code is as follows:
DataSource listGridDS = SRDS.getInstanc("ListGrid");
DataSource dynamicFormDS = SRDS.getInstance("DynamicForm");
DynamicForm dynamicForm = new DynamicForm();
dynamicForm.setDataSource(dynamicFormDS);
SelectItem product = new SelectItem("Product");
product.setAutoFetchData(true);
dynamicForm.setFields(product);
.
.
ListGrid listGrid = new ListGrid();
listGrid.setDataSource(listGridDS);
listGrid.setAutoFetchData(true);
.
.
IButton queryButton = new IButton();
queryButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
listGrid.fetchData(dynamicForm.getValuesAsCriteria());
dynamicForm.clearValues();
}
});
Anyone can guide me please??
Thx for your reply!!
Regards,
Jeff
I got a big problem and didn't know where there was wrong design in my code.
All I want to do is Query Functionality, that is to filter records of ListGrid by a given criteria which is from DynamicForm after fetching data from server-side. But it seems to fetch data from server-side only, not filtering records by a given criteria at all.
My code is as follows:
DataSource listGridDS = SRDS.getInstanc("ListGrid");
DataSource dynamicFormDS = SRDS.getInstance("DynamicForm");
DynamicForm dynamicForm = new DynamicForm();
dynamicForm.setDataSource(dynamicFormDS);
SelectItem product = new SelectItem("Product");
product.setAutoFetchData(true);
dynamicForm.setFields(product);
.
.
ListGrid listGrid = new ListGrid();
listGrid.setDataSource(listGridDS);
listGrid.setAutoFetchData(true);
.
.
IButton queryButton = new IButton();
queryButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
listGrid.fetchData(dynamicForm.getValuesAsCriteria());
dynamicForm.clearValues();
}
});
Anyone can guide me please??
Thx for your reply!!
Regards,
Jeff
Comment