Hello!
Thank you for the example. It works fine and now I can use this approach in my application. But it is not obvious for the people who are not familiar with the internal structure of the component. I mean, what script is sent to the browser. I would have never done it by myself if you hadn't sent me the example. So, I think it is necessary to implement some public method because the task is very general.