Java Reference
In-Depth Information
type of user indentifier as the implementation on the server simply references the
user's data from their Google account.
Listing 7-13. Code for the getCurrentEntries method
private void getCurrentEntries() {
// get all of the milestones for the project
dataService.getEntries(new AsyncCallback<Vector<TimeEntryData>>() {
public void onFailure(Throwable caught) {
handleError(caught);
}
public void onSuccess(Vector<TimeEntryData> entries) {
int row = flexEntryTable.getRowCount();
for (TimeEntryData ted : entries) {
row++;
flexCurrentTable.setText(row, 0,
ted.getProject());
flexCurrentTable.setText(row, 1,
ted.getMilestone());
flexCurrentTable.setText(row, 2,
ted.getBillable() ? "Yes":"No");
flexCurrentTable.setText(row, 3,
DateTimeFormat.getShortDateFormat().format(ted.ge
tDate()));
flexCurrentTable.setText(row, 4,
String.valueOf(NumberFormat.getFormat(".00").form
at(ted.getHours())));
}
}
});
}
You want to fetch the user's current entries at a couple of different points during the
timecard process. First, after the user successfully logs in and is shown the UI, you
want to fetch all of his current entries. Add the following code to the bottom of the
loadMainUI method.
// get the current entries for the user
getCurrentEntries();
 
Search WWH ::




Custom Search