Genesys CTI User Forum

Genesys CTI User Forum => Genesys-related Development => Topic started by: Gabi on December 03, 2014, 12:32:43 PM

Title: Genesys IWS C# extension: programatically open tab
Post by: Gabi on December 03, 2014, 12:32:43 PM
Hello. I am working on an IWS extension and I have created a view and inserted it in a tab within the Workspace region.

Is there any way to make the new tab get focus (and the Workspace region open if it was closed) when receiving a certain event? I mean, is there a way to do it programmatically rather than have the user click buttons manually?

Thank you in advance.
Title: Re: Genesys IWS C# extension: programatically open tab
Post by: Kubig on December 03, 2014, 12:40:13 PM
I think, all is possible :) Try to debug, which methods and objects are called/created during the focusing any tab and try to use it within your code-behind. IWS is just an WPF application, so if it is possible in WPF in general, in IWS will be too.
Title: Re: Genesys IWS C# extension: programatically open tab
Post by: Gabi on December 03, 2014, 05:02:37 PM
Thank you for your reply. That would be a nice thing to be able to do, but I don't have the source for the IWS itself nor its DLLs (other than my own extension), so how can I tell what methods are called when I click on a particular IWS button or focus on a particular tab?
Title: Re: Genesys IWS C# extension: programatically open tab
Post by: PeteHoyle on December 10, 2014, 08:59:45 AM
Hi,

Try something like this:


[code]        private void ShowTab(string name)
        {

            if (Application.Current.Dispatcher != null && !Application.Current.Dispatcher.CheckAccess())
            {
                Application.Current.Dispatcher.Invoke(DispatcherPriority.Send, new ExecuteDelegate(ShowTab), name);
                return;
            }           

            viewEventManager_.Publish(new GenericEvent()
            {
                Target = GenericContainerView.ContainerView,
                Context = "ToolbarWorkplace",
                Action = new GenericAction[]
{
new GenericAction ()
{
Action = ActionGenericContainerView.ActivateThisPanel,
Parameters = new object[] { name }
}
}
            });
            viewEventManager_.Publish(new GenericEvent()
            {
                Target = GenericContainerView.ContainerView,
                Context = "ToolbarWorksheet",
                Action = new GenericAction[]
                    {
                                    new GenericAction ()
                                    {
                                                    Action = ActionGenericContainerView.ShowHidePanelRight,
                                                    Parameters = new object[] { Visibility.Visible, "MyWorkplaceContainerView" }
                                    },
                                    new GenericAction ()
                                    {
                                                    Action = ActionGenericContainerView.ActivateThisPanel,
                                                    Parameters = new object[] { "MyWorkplaceContainerView" }
                                    }
                    }
            });

        }[/code]

Cheers,

Pete.
Title: Re: Genesys IWS C# extension: programatically open tab
Post by: abudwill on December 18, 2014, 08:51:37 PM
Hi Gabi,

I second Pete's example.  This is how I have "programatically clicked" the tabs in the past.  One of the IWS Extension samples also demonstrates this well.

Regards,
Andrew
Title: Re: Genesys IWS C# extension: programatically open tab
Post by: Gabi on December 29, 2014, 12:41:24 PM
Thank you very much, PeteHoyle!