Uploaded image for project: 'Fluid Infusion'
  1. Fluid Infusion
  2. FLUID-5983

expanders can execute more than once if their value is specifically demanded during ginger process

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: IoC System
    • Labels:
      None

      Description

      This issue will take a while to characterise, but there are situations where an expander can execute more than once if the value it delivers is specifically demanded during options evaluation. For example, using the "new viewComponents" with this definition:

          fluid.defaults("fluid.newViewComponent", {
              gradeNames: ["fluid.modelComponent"],
              members: {
                  dom: "@expand:fluid.initDomBinder({that}, {that}.options.selectors, {that}.container)",
                  container: "@expand:fluid.container({that}.options.container)"
              }
          });
      

      and

          fluid.defaults("fluid.author.containerRenderingView", {
              gradeNames: "fluid.newViewComponent",
              invokers: {
                  renderMarkup: "fluid.identity({that}.options.markup.container)"
              },
              container: "@expand:fluid.author.renderContainer({that}, {that}.renderMarkup, {that}.options.parentContainer)",
              // The DOM element which to which this component should append its markup on startup
              parentContainer: "fluid.notImplemented" // must be overridden
          });
      
          fluid.author.renderContainer = function (that, renderMarkup, parentContainer) {
              var containerMarkup = renderMarkup();
              var container = $(containerMarkup);
              parentContainer.append(container);
              return container;
          };
      
      

      A demand via the dom binder of a nested component caused the rendering expander to execute twice - which, since it is stateful, caused two copies of the markup to be generated:

          fluid.defaults("fluid.author.componentView", {
              gradeNames: ["fluid.newViewComponent", "fluid.author.containerRenderingView", "fluid.indexedDynamicComponent", "fluid.author.domPositioning"],
              selectors: {
                  modelView: ".fld-author-modelView"
              },
              components: {
                  modelView: {
                      type: "fluid.author.JSONView",
                      options: {
                          parentContainer: "{componentView}.dom.modelView"
                      }
                  }
              },
      

        Attachments

          Activity

            People

            Assignee:
            antranig Antranig Basman
            Reporter:
            antranig Antranig Basman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: