02-09-2009 08:05 AM
Hello ACT Developers,
I am working on creating a custom tab in the ACT interface. I have the plugin working that adds the tab to the ACT UI and it populates with data for the contact the first contact that is viewed when ACT is opened. I need to know how to refresh the information in the tab when another contact is selected. Can anyone tell me how to do this? I am using ACT 8 for now incase this would make a difference.
02-09-2009 08:29 AM
Would this require a new plugin to capture this event? I used the example in the SDK to add the tab and this seems to only happen in the initail load. Can you explain to me the complete process you would use to capture this event and load/update the custom tab. Do I add/remove the tab for each new contact being viewed, or do I access my custom control (treeview) in the tab abd update it?
02-10-2009 02:10 AM
You can leave the tab and tree view alone, just reload the data into it... below is a very basic sample, hope it helps.
Imports System.Windows.Forms Imports System.Drawing.Design Imports System.Drawing Imports System.ComponentModel.Design Imports Act.Framework Imports Act.UI Public Class Class1 Implements IPlugin Private ActApp As ActApplication 'Reference to the ACT! Application Private Tab As TabPage Public Sub New() End Sub 'New Public Sub OnLoad(ByVal App As ActApplication) Implements IPlugin.OnLoad ActApp = App 'Store a reference to ActApplication AddHandler ActApp.ViewLoaded, AddressOf ActApp_ViewLoaded AddHandler ActApp.AfterLogon, AddressOf ActApp_AfterLogon End Sub 'OnLoad Private Sub ActApp_AfterLogon(ByVal sender As Object, ByVal e As System.EventArgs) 'on logon trap the contact changed event AddHandler ActApp.CurrentContactChanged, AddressOf CurrentContactChanged End Sub Private Sub ActApp_ViewLoaded(ByVal Sender As Object, ByVal e As Act.UI.ViewEventArgs) 'create your tab here Tab = New TabPage '.......... End Sub Public Sub OnUnLoad() Implements IPlugin.OnUnLoad '// End Sub 'OnUnLoad Private Sub CurrentContactChanged(ByVal sender As Object, ByVal e As System.EventArgs) 'current contact has changed, refresh your data UpdateTab() End Sub Private Sub UpdateTab() 'put your logic to load the data into here '............ End Sub End Class