3

I'm trying to add a link to the work item control in TFS 2012 Web Access. What I'm seeing, however, is that the functions I'm defining for bind and _init aren't getting called at any point in the page lifecycle.

Here's some pared down code:

TFS.module("TFS.WA.ProofOfConcept",
 [
 "TFS.WorkItemTracking.Controls",
 "TFS.WorkItemTracking",
 "TFS.Core"
 ],
 function () {
     var WITOM = TFS.WorkItemTracking,
     WITCONTROLS = TFS.WorkItemTracking.Controls,
     delegate = TFS.Core.delegate,
     moduleBaseUrl = TFS.getModuleBase("TFS.WA.ProofOfConcept");

     function ProofOfConcept(container, options, workItemType) {
         this.baseConstructor.call(this, container, options, workItemType);
     }

     ProofOfConcept.inherit(WITCONTROLS.WorkItemControl, {
         _control: null,

         // Initialize the control UI without data (in "blank" state).
         _init: function () {
             this._base();

         },

         bind: function (workItem) {
             this._base();

         },

         // Update the control data
         invalidate: function (flushing) {

         },

         // Clear the control data
         clear: function () {

         }

     });


     WITCONTROLS.registerWorkItemControl("TFS.WA.ProofOfConcept", ProofOfConcept);

     return {
         ProofOfConcept: ProofOfConcept
     };
 });

The extension loads, and I can set a breakpoint on the module and see it getting constructed. I'm sure I'm missing something extremely silly, but I can't see it.

Here's the manifest.xml:

<WebAccess version="11.0">
  <plugin name="POC" vendor="Acme" moreinfo="http://www.acme.com" version="1.0.0" >
    <modules>
      <module namespace="TFS.WA.ProofOfConcept" kind="TFS.WorkItem.CustomControl"/>  
    </modules>
  </plugin>
</WebAccess>
Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
  • This is seriously driving me insane. I just want a super-duper barebones working example of a work item control extension. It seems like Microsoft changed something in the API in Update 2 onward that rendered every example out there incorrect. – Daniel Mann Oct 11 '13 at 01:02

1 Answers1

1

I suggest you to access http://YourServer:8080/tfs/_diagnostics and activate debug mode by selecting Enabled link.

enter image description here

Aghilas Yakoub
  • 28,516
  • 5
  • 46
  • 51
  • thanks a lot for this one. It really saved my life, didn't know this and was struggling minified code, now it is amazing(: – Beytan Kurt Jul 09 '14 at 13:33