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

Cannot use distributeOptions to distribute an option when the source points at a value of 0

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 3.0
    • Component/s: Framework, IoC System
    • Labels:
      None

      Description

      When trying to use distribute options to pass along an option to another component, if using the source property to point at a value of 0, it is not passed along.

      Example:

          fluid.defaults("fluid.tests.distributeOptionsZero", {
              gradeNames: ["fluid.component"],
              components: {
                  child: {
                      type: "fluid.component"
                  }
              },
              toDistribute: 0,
              distributeOptions: [{
                  source: "{that}.options.toDistribute",
                  target: "{that child}.options.fromSource"
              }]
          });
      

      However, if the "record" property is used instead, it will be passed along.

      Example:

          fluid.defaults("fluid.tests.distributeOptionsZero", {
              gradeNames: ["fluid.component"],
              components: {
                  child: {
                      type: "fluid.component"
                  }
              },
              distributeOptions: [{
                  record: 0,
                  target: "{that child}.options.fromRecord"
              }]
          });
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: