My form contains a ComboBox and a TextField. Whenever the user selects something in the ComboBox, the TextField's content is set to some value depending on the selection. The problem is that the TextField has a Validator attached which takes a long time to process. Only after the validation is complete, the TextField's new value is shown. Is it possible to show the new value before the validation or somehow doing the validation in a background thread? As the Validator implements an interface with a boolean method, I have to return something so I don't know how I could do this.
0
votes
1 Answers
1
votes
You could try the Refresher addon. Don't add a validator using addValidator(Validator)
method but add a ValueChangeListener
and run the validator in a background thread.
Just add the Refresher somewhere in your layout and enable it after the value of the text field has changed. You can start a new thread in the valueChange
method and let Refresher poll the server side until the validator has finished.
Let me know if you need an example. I haven't done this by myself but this is how I would try to solve the problem.