Hello
I am trying to automagically expand the Validation side view after opening Web Author.
I am calling workspace.getViewManager().focusView('validation-panel-table') in my plugin.js but I get error
"workspace-22991562a3.js:3699 Uncaught TypeError: Cannot read property 'focus' of undefined
at sync.view.WorkspaceViewManager.focusView"
After the Editor is loaded I can call workspace.getViewManager().focusView('validation-panel-table') in browser console the Validation side view is expanded.
What is the proper place to call focusView? Is there another way to expand Validation side view?
Thanks,
Manu
calling focusView with Web Author
-
- Posts: 50
- Joined: Thu Jun 09, 2016 2:01 pm
Re: calling focusView with Web Author
Hello,
To expand the validation side-view after opening a document you can use the EDITOR_LOADED event [1].
Best,
Gabriel
[1] https://www.oxygenxml.com/maven/com/oxy ... Event.html
To expand the validation side-view after opening a document you can use the EDITOR_LOADED event [1].
Code: Select all
goog.events.listen(workspace, sync.api.Workspace.EventType.EDITOR_LOADED, function(e) {
// You will have to use setTimeout because the side-views are shown immediately after the EDITOR_LOADED event.
setTimeout(function () {
workspace.getViewManager().focusView('validation-panel-table')
});
});
Gabriel
[1] https://www.oxygenxml.com/maven/com/oxy ... Event.html
Re: calling focusView with Web Author
Hello
I was missing the setTimeout-function.
Thanks!
I was missing the setTimeout-function.
Thanks!