Hi,
Current I am building a JavaFX RESTful client with DataFX. However, I ran into a problem due to DataFX is retrieving data in the background thread. In my Login window, once user click on login, I will call the following code in my UI controller
public ObjectProperty<RestResponse> login(String userName, String password) {
RestSource<RestResponse> restSource = new RestSource("url to my service", new JsonConverter(RestResponse.class));
ObjectDataProvider provider = new ObjectDataProvider(restSource);
provider.retrieve();
return provider.getData();
}
However, since data retrieving is done in a background thread, at that moment, provider.getData() is not populated. How can I let my application pause and wait until data available?
Thanks so much for your help,
Tai