Hitachi Vantara Pentaho Community Wiki
Skip to end of metadata
Go to start of metadata

This is a place to share your dashboard designs either as screen shots or including all the sources.


  1. user-2544b

    Button, Button, Who's Got the Button?

    One of the great things about the CDF is the concept of listeners, where you can easily set components like charts to listen on the controls like select lists. These charts update automatically when the listener is changed, which is an awesome feature.

    But there are cases where you don't want this behavior. When you're selecting interim lists of values or even under the date picker, constant refreshing can slow the user experience. How do you change this feature in cases where you want the charts to be refreshed on demand by the user on the click of a button? Try this:

    1. Add a button in the desired location for your selected dashboard in template.html, and include a reference to a function that you'll create. This function could be named anything, in this example it's called "refresh_charts()"

    <"BUTTON" name="refresh" value="Refresh" OnClick="refresh_charts()">

    2. Remove the listeners from your chart component in template.html. It should look something like this:

    chart_a =
      name: "chart_a",
      type: "xaction",
      solution: "dashboards",
      path: "path_name",
      action: "chart_a.xaction",
      parameters: [["STARTDATE","startDate"],["ENDDATE","endDate"]],
      htmlObject: "object_a",
      executeAtStart: true,

    3. Then at the bottom on your template.html, below the load() function, add the function specified earlier in the button to refresh the charts. In this case, it refreshes chart_a, specified above in step 2.

    function refresh_charts(){

    That should work. Give it a try and see if it works for you.

  2. user-6de53

    In step number one I think there is a little mistake: I think that you have to put the button like this

    <input type="button" name="refresh" value="Refresh" OnClick="refresh_charts()" />

    See you