I am facing a dilemma.
when an Activity starts, I use RequestFactory to retrieve some data.
- I don't know however when should I update the view responsible for
displaying the data.
in the code below, I have identified two place holders ## A ## and ##
B ###
and another question:
- is a call on RequestFactory blocking (synchronous) ?
in other words, when we call RF, as the code below,
will the code wait (blocks) for the RF call to return, before
proceeding with the rest of the statements,
or does it Fire the request, and immediately returns the control to
the program,
continuing with other statements which are after that anonymous inner
class that is inside the RF ?
public class EmployeeListActivity extends AbstractActivity {
EmployeeListView view;
List<EmployeeProxy> tempResultHolder = new ArrayList<EmployeeProxy>();
.....
public void start(AcceptsOneWidget panel, EventBus eventBus)
requestFactory
.employeeRequest()
.findAllEmployees()
.fire(new Receiver<List<EmployeeProxy>>() {
@Override
public void onSuccess(List<EmployeeProxy>
response) {
##### A #### when to update the View ?
panel.setWidget(view.asHasData().setRowData(0,
response);
or
##B1 tempResultHolder.addAll(response);
}
});
--------> does it block here ? --- do we get past this line only after
RF returns ?
when do we get here ?
##### B2 ####
panelSetWidget(view.asHasData().setRowData(0,
tempResultHolder);
}//Activity start method end
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.