Genesys CTI User Forum > Genesys-related Development

Create/add own button to existing view.

(1/4) > >>

MJaskowski:
Hello everyone,

I have question about create/add new button to existing view. Is it possible?

I want add button programatically to ContactInfoHistoryMultiRegion and exactly to ContactInformationView -> DockPanelContactHistoryContent -> Toolbar_Copy. I can't access to it and I don't know how to bite it. Did you have similar case?

Thank you for all tips.

Regards
Matt

cavagnaro:
Check WDE samples. There is a Button sample.


Enviado de meu SM-N9600 usando o Tapatalk

MJaskowski:
Hello cavagnaro,

thank you for answer. I know sample with button, I hope we talk about the same sample - I can create buttton in my NEW/OWN view, for example to ToolbarWorkplaceRegion I add new tab with button, right?

But my question is about existing view created default in WDE and more precisly I'm talking about Contacts History Tab. Or maybe I misunderstood you? Could you expand your thought?

cavagnaro:
Yeah, same, just get the View name, also at Documentation, and elaborate into that.


Enviado de meu SM-N9600 usando o Tapatalk

MJaskowski:
Cavagnaro,

I suppose to do something wrong or I don't know about any method. I found where is my problem, I'm adding new ViewActivator to ContactTabBottomHistoryMultiRegion but this region doesn't exist yet when ExtensionModule do Initialize() method.

[code]
public void Initialize()
{           
    container.RegisterType<IMyView, MyView>();
    container.RegisterType<IMyViewModel, MyViewModel>();
}

[/code]

then I made viewEventManager.Subscribe(CheckingEvent) which raise event after select email in ContactHistoryView

[code]

private void CheckingEvent(object obj)
        {
            string loadedAction = (obj as GenericEvent).Action[0].Action as string;
            ViewActivator toolbarContainer = null;

            if (loadedAction == "LoadInteractionInformation")
            {
                foreach (ViewActivator view in viewManager.ViewsByRegionName["ContactInfoHistoryMultiRegion"])
                {             
                    if (view.ViewName == "ContactInformationView")
                    {
                        viewManager.ViewsByRegionName["ContactTabBottomHistoryMultiRegion"].Add(
                              new ViewActivator()
                              {
                                  ViewType = typeof(IMyView),
                                  ViewName = "MyView",
                                  ActivateView = true
                              }
                        );                     
                        break;
                    }
                }
            }           
        }

[/code]

ViewActivator correctly add to region but unfortunately I don't see result. If I will add the same view to eg. ToolbarWorkplaceRegion, I see my view. I can't catch what is point.

Should I do it any other way?






Navigation

[0] Message Index

[#] Next page

Go to full version