Hi all,
I need an advice about a design question of my application. I am searching
for a best practise for the following setup.
Project is about an application for maintaining huge amounts of data from a
database. Therefore I implemented a ui with UIBinder and a CellTable, data
is provided by AsyncDataProvider. Layout is including paging. So basically
in my ui class I have something like this:
@UiHandler("loadButton")
void onLoadButtonClick(ClickEvent event) {
AsyncDataProvider<Model> provider = new AsyncDataProvider<Model>() {
@Override
protected void onRangeChanged(HasData<Model> display) {
final int start = display.getVisibleRange().getStart();
int length = display.getVisibleRange().getLength();
// Get the ColumnSortInfo from the table.
final ColumnSortList sortList = cellTable.getColumnSortList();
AsyncCallback<List<Model>> callback = new AsyncCallback<List<Model>>() {
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage());
}
@Override
public void onSuccess(List<Model> result) {
updateRowData(start, result);
}
};
dataService.loadData(start, length, callback);
}
};
}
I want to add column sorting to my view as well. Colum sorting also works
with the onRangeChanged method. And here starts my problem. What is the
best way to differ between my normal search request and a column sorting
request? Do I need to differ?
In my application so far I calculate which the next datasets for the ui are
( <- sounds strange? MS Word told me so). When processing always the same
requests I need to analyse the source of the onRangeChanged event to go
back on page one for a sort event.
I don’t want to build a wrapping request with internal processing mode or
something. Also I didn’t thought of the how to until now.
So please group, what is the best way to get a clean interface with
different methods for the different ui events?
I hope my question is clear because it was very hard to describe and even
now I must say the description is not good. I hope the point will be clear.
Thanks in Advance.
Best regards
Jochen
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.