Hi
I have a plugin that is used to set the default view. It has a side panel plugin and when this starts it runs the SendMessage command below with the data containing the screen, window and view
EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(MessageId.SmartClient.MultiWindowCommand, data));
This used to work fine in smart client 2022 R1, but after upgrading the smart client to 2023 R1 I get following error when the client starts
Error: MultiWindowCommandHandler ():Exception source: VideoOS.RemoteClient.Application
Exception type: System.NullReferenceException
Exception message: Object reference not set to an instance of an object.
Exception target site: get_SelectedViewSelector
at VideoOS.RemoteClient.Application.Controllers.ViewSelection.ApplicationViewSelectionObserver.get_SelectedViewSelector()
at VideoOS.RemoteClient.Application.MIP.Manager.MessageManager.MultiWindowCommandHandler(Message message, FQID dest, FQID source)
Once the client has started I can run the command and it works ok. Has there been a change in the start order in the client? Is there a way I can check if the object has been set?
Thanks
Ian
Are you calling the from the Init() method of the SidePanelPlugin? If you call it from the constructor for the SidePanelPlugin please move it to the Init(). If you do something else please describe what it is.
Hi Bo
Thanks for the reply. I’m calling the method from the init() from the SidePanelWpfUserControl. Should I call this from the init () in the SidePanelPlugin instead?
Also forgot to mention that the command it is sending is MultiWindowCommand.SetViewInWindow
Here’s the code from the method. It’s collected the screen, window and view data earlier
MultiWindowCommandData data = new MultiWindowCommandData();
data.Screen = screen != null ? screen.FQID : null;
data.Window = Windows[0] != null ? Windows[0].FQID : null;
data.View = viewItem != null ? viewItem.FQID : null;
data.MultiWindowCommand = MultiWindowCommand.SetViewInWindow;
EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(MessageId.SmartClient.MultiWindowCommand, data));
Thanks
Ian
I made a curious observation while reproducing the issue.
In the versions 2022R1, 2022R2 and 2022R3 there is no exception. However the functionality does not work! I am not being sent to the view when this executes from the SidePanelWpfUserControl Init, but the same code works later and send me to the expected view when on a button that I press later.
In the versions 2023R1 and 2023R2 there is the exception you have reported.
With the exception it comes as no surprise that the functionality does not work. The same code works later and send me to the expected view when on a button that I press later.
Could you please comment? Does the functionality actually work for you on the SidePanelWpfUserControl Init?
It seems to me the exception is a good thing as you are actually told that the functionality does not work. Now this is of course not the case if your observations is that it works. I hope you can clarify whether it works for you..
Hi Bo
I un-installed the 2023 R1 client, reinstalled the 2022 R1 client and the plugin works again when the client starts. I’ve double checked and the only place the method is being called from during the startup is from the SidePanelWpfUserControl Init().
Could I send you my code for you to try? Maybe via a Helpdesk case
Thanks
Ian
Thanks for testing, I very strongly suspected that the plugin would initialize without raising exception, but you would not see the view change that running SetViewInWindow would cause. You will have to test a scenario where it would start with another view if the SetViewInWindow was not executed.
With that being clear I will open a support case and ask for your plugin source code for reproduction and debugging.