0 Replies Latest reply on Aug 29, 2015 7:28 PM by Robert Rouse

    Populating Form Data During Interactive Phase (editing a connection)

    Robert Rouse

      I have been trying to make something work that I saw in the StockQuoteConnector_advanced.html example. It is supposed to read the tableau.connectionData variable to populate form inputs when editing an existing connection. I have found that it works as expected in the simulator but doesn't seem to do it in Tableau (Beta 4-Mac). Below is the relevant code.

       

      From the StockQuoteConnector_advanced.html file in the SDK:

        myConnector.init = function() {
          // If we are in the interactive phase, repopulate the input text box if there is connectionData present. 
          // This is hit when editing a connection in Tableau.
          if (tableau.phase == tableau.phaseEnum.interactivePhase) {
            $('input[type=text]').val(tableau.connectionData);
          }
      
      
          tableau.incrementalExtractColumn = 'Day';
          tableau.initCallback();
        };
      

       

      Here's my code, which is nearly a carbon copy of that, but which fails in the simulator saying "cannot read property 'interactivePhase' of undefined". If I comment out the if statement, everything else works just fine.

       

            myConnector.init = function () {
                // If we are in the interactive phase, repopulate the input text box if there is connectionData present. 
                   if (tableau.phase == tableau.phaseEnum.interactivePhase) {
                     var formData = JSON.parse(tableau.connectionData);
                     $('input[name=inputurl]').val(formData.formInput);
                   }
                tableau.initCallback();
            };
      

       

       

      What's going on with this? Is it a WDC bug or a code error?