23 Replies Latest reply on Apr 28, 2017 1:01 PM by chris.wilkinson.8181

    Problems saving and retrieving Tile Config

    chris.wilkinson.8181

      Hello,

       

      We have a custom view tile which we're trying to implement for Jive 9.0.0.0.  We have a problem where we can successfully save config properties for our Tile Instance, but we can't load the config properties when our Tile Instance is viewed.

       

      On the config page, we make a call to save the tile's config like this:

                $("#btn_submit").click( function() {
                    config["data"] = { 
                        "containerId" : 2001,
                        "foo": "bar",
                        "some_number" : 123
                    }
                   
                    console.log("Saving config: " + JSON.stringify(config));
                    jive.tile.close(config, {} );
      
                    gadgets.window.adjustHeight(300);
                   
                });
      

       

      This works, and we've traced it all the way to Jive's database to see that the config is stored.  The SQL query:

      select tileinstanceid, tileid, config from jivetileinstance;

       

      Returns this result, with the correct config attached to the Tile Instance:

      Screen Shot 2017-02-27 at 8.55.43 AM.png

       

      We've also seen this in many examples on Jive's GitHub account, including the Twitter tile: GitHub - jivesoftware/twitter-widget-tile: This is an example implementation of a Twitter Widget in a Jive Tile .

       

      However, when we view our Tile, we can't load its config - the config object is empty .  Here's what we're trying:

              jive.tile.onOpen(function(config, options, global, container) {
                console.log("config: " + JSON.stringify(config));
                console.log("options: " + JSON.stringify(options));
                console.log("global: " + JSON.stringify(global));
                console.log("container: " + JSON.stringify(container));
              });
      

       

      The console output of the above is as follows:

      config: {}

      options: {"definitions":[],"tileInstanceId":"1019"}

      global: {}

      container: {"type":"14","id":"2001","name":""}

       

      If the config is stored properly, shouldn't it be populated when it's passed as a parameter to jive.tile.onOpen()?  Again, this is how the Twitter Tile works.

       

      Any ideas as to what we're missing?

       

      Thank you,

       

      Chris

       

      v

       

      e.tile.onOpenAn