I’ve tried doing this but only one panel gets the Widget shown. What is the approach to add an instance of a Widget into many panels? Or is it even possible?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If by inject, you mean use some DI tool (like Guice), then yes, you can inject the instance into many other instances as a singleton (just like any other singleton).
However, a given Widget can only be rendered in one place at a time. Elements can be cloned, but there is no general method of copying a widget to draw it in more than one place, mostly due to all of the event handlers that have to be added again.