Accessing to a custom widget by using WidgetManager #9540
Replies: 10 comments
-
Have you checked that a factory is registered and widgets are always created via |
Beta Was this translation helpful? Give feedback.
-
I am calling |
Beta Was this translation helpful? Give feedback.
-
Calling |
Beta Was this translation helpful? Give feedback.
-
I see, then I should change the way I create the widget. But how can I pass some arguments that I can use them to set some fields in my widget's constructor. |
Beta Was this translation helpful? Give feedback.
-
I assume I need to write setters in my widget class in order to set those fields |
Beta Was this translation helpful? Give feedback.
-
The second arg is to pass custom options. |
Beta Was this translation helpful? Give feedback.
-
I am trying to pass a
|
Beta Was this translation helpful? Give feedback.
-
It should be JSON object. These options are stored as a part of the layout information and used to recover the widget on reload. A URI can be converted to the string and then converted back to a URI in the factory. |
Beta Was this translation helpful? Give feedback.
-
Thank you, I managed to create what I need by extending |
Beta Was this translation helpful? Give feedback.
-
Right, it is the good base class if you want to provide a widget per a URI, like editors, previews and so on. Other notable abstractions:
We should add code examples to our docs. For now, you are better to study files where these concepts are declared and their usages. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am trying to access a custom widget by calling
getWidget(factoryId)
method ofWidgetManager
, however I don't see my widget id infactories
. Is using widget manager correct way to access widgets?Beta Was this translation helpful? Give feedback.
All reactions