Access Keys:
Skip to content (Access Key - 0)

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


  1. Jun 20, 2008

    Kevin Haas says:

    Button, Button, Who's Got the Button? One of the great things about the CDF is ...

    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",
      listeners:[],
      parameters: [["STARTDATE","startDate"],["ENDDATE","endDate"]],
      htmlObject: "object_a",
      executeAtStart: true,
      preExecution:function(){},
      postExecution:function(){}
    }
    

    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(){
        Dashboards.update(chart_a);
    }
    

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

  2. Aug 28, 2008

    jorge ernesto maria arroyo says:

    In step number one I think there is a little mistake: I think that you have to p...

    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

This documentation is maintained by the Pentaho community, and members are encouraged to create new pages in the appropriate spaces, or edit existing pages that need to be corrected or updated.

Please do not leave comments on Wiki pages asking for help. They will be deleted. Use the forums instead.

Adaptavist Theme Builder (4.2.0) Powered by Atlassian Confluence 3.3.3, the Enterprise Wiki