Genesys CTI User Forum > Genesys-related Development

Genesys IWS C# extension: programatically open tab

(1/2) > >>

Gabi:
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.

Kubig:
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.

Gabi:
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?

PeteHoyle:
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.

abudwill:
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

Navigation

[0] Message Index

[#] Next page

Go to full version