Creating custom component problem

Hello!

I create some component in Vaadin wrapping GWT widget under a vaadin layer.
There is a function (for example, named func()) on server-side of component. That function func() sends request to client-side using setValue() method (thereby calling paintContent(PaintTarget target)).
Then func() must wait response from client-side and after giving response does something.
So I have a problem: I can’t get response from client side.
Function changeVariables() on server side is not performed, I think, because func() is still running, trying to wait desired response.
So how can I get request to client-side and get response from it inside my single function? Is it possible?

Best regards, Kseniya.