Skip to main content

Cascading parameters, how to update the child parameters and a charting object at the same time.

Comments

2 comments

  • VISUI

    In an example of three hierarchically chained inputs:  Company, City, Employee

    When inputs are chained and also refresh another element such as a chart, Logi will still pass the previous value of any subsequently chained inputs during the refresh. To fix this the Action.Refresh element on each element must pass empty values for any subsequently chained inputs using Link Parameters on the Action.Refresh in order to empty out those input's values so that invalid values aren't passed to the chart.

    For example, if I change my selection for City, Logi will still pass my previously selected Employee to the Chart, unless I add a blank value for Employee as a Link Parameter on City's Action.Refresh.

    If you have three chained inputs and all three are required to render the chart:

    • target your refresh on a container DIV element.
    • add a child DIV element with a condition requiring all three input values.
    • add your chart as a child element of the conditioned div.

    Add an IfDataError element with a empty static data layer on the chart's datalayer to capture any sql errors.

    I wouldn't go the route of arbitrary first values because in order to do so you need will need to run queries to get each of the values as Local Data then assign them to Default Request Parameters.  An input element's Default Value's element will set the value in the input UI, but doesn't automatically pass the selected value onto the chart.

    0
  • VISUI
    <Report ID="LogiForum.chainedelements">
      <LocalData>
        <DataLayer Type="Static">
          <StaticDataRow Company="Acme" City="Washington D.C." Employee="Joe Schmoe" />
          <StaticDataRow Company="Acme" City="Washington D.C." Employee="Mary Sheltz" />
          <StaticDataRow Company="Acme" City="Boston" Employee="Dave Getz" />
          <StaticDataRow Company="Acme" City="Boston" Employee="Tim Smith" />
          <StaticDataRow Company="Amazon" City="Pittsburgh" Employee="Dan Blank" />
          <StaticDataRow Company="Amazon" City="Pittsburgh" Employee="Marty McFly" />
          <StaticDataRow Company="Amazon" City="Pittsburgh" Employee="Greta Green" />
          <StaticDataRow Company="Amazon" City="Boston" Employee="Joe Mama" />
          <DataLayerLink ID="dllinked" />
        </DataLayer>
      </LocalData>
      <Body>
        <Division ID="divFilters">
          <InputSelectList ID="Company" OptionCaptionColumn="Company" OptionValueColumn="Company" DefaultValue="@Request.Company~" Caption="Company" IncludeBlank="True" IncludeBlankCaption="Select...">
            <DataLayer Type="Linked" LinkedDataLayerID="dllinked">
              <DeDuplicateFilter DataColumns="Company" />
            </DataLayer>
            <EventHandler DhtmlEvent="onchange">
              <Action Type="RefreshElement" ElementID="divFilters,divReport" ID="are">
                <LinkParams City="" Employee="" />
              </Action>
            </EventHandler>
          </InputSelectList>
          <LineBreak />
          <InputSelectList ID="City" OptionCaptionColumn="City" OptionValueColumn="City" DefaultValue="@Request.City~" Caption="City" IncludeBlank="True" IncludeBlankCaption="Select...">
            <DataLayer Type="Linked" LinkedDataLayerID="dllinked">
              <DeDuplicateFilter DataColumns="City" />
              <CompareFilter CompareType="=" DataColumn="Company" ID="cfCompany" CompareValue="@Request.Company~" IncludeCondition="len(&quot;@Request.Company~&quot;) &gt; 0" />
            </DataLayer>
            <EventHandler DhtmlEvent="onchange">
              <Action Type="RefreshElement" ElementID="divFilters,divReport" ID="are">
                <LinkParams Employee="" />
              </Action>
            </EventHandler>
          </InputSelectList>
          <LineBreak />
          <InputSelectList ID="Employee" OptionCaptionColumn="Employee" OptionValueColumn="Employee" DefaultValue="@Request.Employee~" Caption="Employee" IncludeBlank="True" IncludeBlankCaption="Select...">
            <DataLayer Type="Linked" LinkedDataLayerID="dllinked">
              <DeDuplicateFilter DataColumns="Employee" />
              <CompareFilter CompareType="=" DataColumn="Company" ID="cfCompany" CompareValue="@Request.Company~" IncludeCondition="len(&quot;@Request.Company~&quot;) &gt; 0" />
              <CompareFilter CompareType="=" DataColumn="City" ID="cfCity" CompareValue="@Request.City~" IncludeCondition="len(&quot;@Request.City~&quot;) &gt; 0" />
            </DataLayer>
            <EventHandler DhtmlEvent="onchange">
              <Action Type="RefreshElement" ElementID="divFilters,divReport" ID="are" />
            </EventHandler>
          </InputSelectList>
          <LineBreak />
        </Division>
        <Division ID="divReport">
          <Division ID="divChart" Condition="len(&quot;@Request.Company~&quot;) &gt; 0 &amp;&amp; len(&quot;@Request.City~&quot;) &gt; 0 &amp;&amp; len(&quot;@Request.Employee~&quot;) &gt; 0">
            <ChartCanvas>
              <Series Type="Bar" ChartYDataColumn="rdCrosstabValue">
                <DataLayer Type="Linked" LinkedDataLayerID="dllinked">
                  <CompareFilter CompareType="=" DataColumn="Company" ID="cfCompany" CompareValue="@Request.Company~" IncludeCondition="len(&quot;@Request.Company~&quot;) &gt; 0" />
                  <CompareFilter CompareType="=" DataColumn="City" ID="cfCity" CompareValue="@Request.City~" IncludeCondition="len(&quot;@Request.City~&quot;) &gt; 0" />
                  <CompareFilter CompareType="=" DataColumn="Employee" ID="cfEmployee" CompareValue="@Request.Employee~" IncludeCondition="len(&quot;@Request.Employee~&quot;) &gt; 0" />
                  <CrosstabFilter CrosstabColumn="Company" CrosstabLabelColumn="City" CrosstabValueColumn="Employee" CrosstabValueFunction="Count" />
                  <IfDataError ID="ifDataError">
                    <DataLayer Type="Static" />
                  </IfDataError>
                </DataLayer>
              </Series>
            </ChartCanvas>
            <Label Caption="Company:  @Request.Company~" HtmlTag="h4" />
            <Label Caption="City:  @Request.City~" HtmlTag="h4" />
            <Label Caption="Employee:  @Request.Employee~" HtmlTag="h4" />
          </Division>
        </Division>
      </Body>
      <ideTestParams Company="" City="" Employee="" />
    </Report>
    1

Please sign in to leave a comment.