Spark: sub-components within custom component not rerendering when underlying model changes


Just to close the loop on this, apparently there is a minor bug in skuid where the fields for models created dynamically via a javascript object are not getting their metadata loaded. As a work-around, you can:

  1. form the model dynamically via XML instead of a javascript object, or
  2. [***WARNING undocumented property!!] force the model to load the metadata by adding a property to the js object for the model: needsMetadataLoad = true [/WARNING]
Thanks again for your help on this one, Zach!

By “Models created dynamically via a JavaScript object”, Matt means passing a plain javascript object into the Model constructor, e.g. this:

new skuid.model.Model({
    objectName: "Contact",
    recordsLimit: 20,
    fields: [
         { id: "FirstName" }

As opposed to providing an XML definition to the constructor:

new skuid.model.Model(skuid.utils.makeXMLDoc( '<model datasource="salesforce" sobject="Contact" limit="20" query="true">
       <field id="FirstName">
       <field id="LastName">
</model>' ));

If you provide an XML definition to the constructor, then things should work fine in Millau / Spark, but if you provide a Javascript object, then no metadata will be loaded if you call “.load()” on your dynamically-created Model — this is a bug we will be addressing soon, either in a 12.2 patch or in 12.3.