Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8912407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:11:25+00:00 2026-06-15T04:11:25+00:00

Is there a simple way to modify a dashlet to automatically re-load itself periodically?

  • 0

Is there a simple way to modify a dashlet to automatically re-load itself periodically?

I am particularly thinking of the “My Tasks” dashlet – we are using pooled review workflows, so tasks may come and go all the time as they are created and then are claimed.

It may be frustrating for users to keep clicking on tasks that turn out to have already been claimed – or having to remember to keep re-loading their Dashboard page. I’d prefer the dashlet to refresh on a timed interval so it’s always reasonably up to date.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T04:11:26+00:00Added an answer on June 15, 2026 at 4:11 am

    In order to do this you will need to add a new capability to the client-side class Alfresco.dashlet.MyTasks (docs, source) found in the file components/dashlets/my-tasks.get.js. First you will need to add a new method to the prototype extension specified as the second parameter in the YAHOO.lang.augmentObject() call, e.g.

          ...
          }, // end of last OOTB function - add a comment here
    
          // begin changes
          reloadData: function MyTasks_onReady()
          {
             this.widgets.alfrescoDataTable.loadDataTable(
                this.options.filters[this.widgets.filterMenuButton.value]
             );
          }
          // end changes
       });
    })();
    

    It’s not the ideal development environment, you can modify the JS file directly in the Share webapp, although you will also need to update the corresponding -min.js file.

    Once you’ve done this, check that it works by running the following line in your browser’s JavaScript console

    Alfresco.util.ComponentManager.findFirst("Alfresco.dashlet.MyTasks").reloadData();
    

    If that works, then you can wire up your new method to a title bar action (see my DevCon presentation for more background info), in the dashlet web script. The method depends on whether you are using v4.2 or a previous version, but if it is the latter then you need to add some code to the dashlet’s Freemarker file my-tasks.get.html.ftl (under WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/dashlets).

    In that file you should see some JavaScript code inside a <script> tag, this sets up an instance of the client-side class and some utility classes, the contents of which you can replace with the following, to add your custom title bar action.

    (function()
    {
       var dashlet = new Alfresco.dashlet.MyTasks("${jsid}").setOptions(
       {
          hiddenTaskTypes: [<#list hiddenTaskTypes as type>"${type}"<#if type_has_next>, </#if></#list>],
          maxItems: ${maxItems!"50"},
          filters:
          {<#list filters as filter>
             "${filter.type?js_string}": "${filter.parameters?js_string}"<#if filter_has_next>,</#if>
          </#list>}
       }).setMessages(${messages});
       new Alfresco.widget.DashletResizer("${id}", "${instance.object.id}");
       var refreshDashletEvent = new YAHOO.util.CustomEvent("onDashletRefresh");
       refreshDashletEvent.subscribe(dashlet.reloadData, dashlet, true);
       new Alfresco.widget.DashletTitleBarActions("${args.htmlid}").setOptions(
       {
          actions:
          [
             {
                cssClass: "refresh",
                eventOnClick: refreshDashletEvent,
                tooltip: "${msg("dashlet.refresh.tooltip")?js_string}"
             },
             {
                cssClass: "help",
                bubbleOnClick:
                {
                   message: "${msg("dashlet.help")?js_string}"
                },
                tooltip: "${msg("dashlet.help.tooltip")?js_string}"
             }
          ]
       });
    })();
    

    You will need to add some styles for the class name specified, in the dashlet’s CSS file my-tasks.css, such as the following

    .my-tasks .titleBarActions .refresh
    {
        display: none;
        background-image: url('refresh-icon.png');
    }
    

    The icon file (here is one you could re-use) must be in the same directory as the CSS file.

    Lastly you’ll need to define the label dashlet.refresh.tooltop used for the title bar action’s tooltip. You can do this in the dashlet web script’s .properties file.

    For a similar example, check out the source of my Train Times dashlet, which features a refresh title bar action.

    In some ways it’s actually easier to define your own dashlets than it is to extend the Alfresco-supplied ones, but if you have the option of using 4.2.x, the new method allows you to extend the existing components without duplicating any code, which obviously makes upgrades much easier.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there a simple way to modify the InnerXml of a XElement? supose we
In git, is there any (simple) way to modify the index so that only
Is there a way to allow admins to modify the content of simple static
Is there a simple way to modify/customize error messages generated by Symfony validators? eg.
Is there a simple way to modify a table in recent sqlite versions so
Is there a simple way to take a given file path and modify it
I was wondering if there's any simple way to modify and add a new
Is there a simple way to insert the current time (like TIME: [2012-07-02 Mon
Is there a simple way to serialize a single-level structure as a string for
Is there a simple way, possibly with open-source command line tools in Linux, to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.