cancel
Showing results for 
Search instead for 
Did you mean: 

Clone of my-sites dashlet causes args.html undefined

cybertoast
Champ in-the-making
Champ in-the-making
I'm creating a relatively basic webscript. My intention is to customize the my-sites dashlet. I've started by just copying all the my-sites* files in the site-webscripts/org/alfresco/components/dashlets/ and webapps/share/components/dashlets/ folders to my-sites-custom*. I've also changed the function calls in the appropriate places.

When I launch the dashlet from /share/service/components/dashlets/my-sites-custom I get this error:

Exception: freemarker.core.InvalidReferenceException - Expression args.htmlid is undefined on line 2, column 44 in org/alfresco/components/dashlets/my-sites-custom.get.html.ftl.

What am I doing wrong?
3 REPLIES 3

mikeh
Star Contributor
Star Contributor
The Share components expect to live within a Share template - where they are automatically passed a unique htmlid with which to create DOM element ids.

If you're testing the dashlet outside Share, simply append "?htmlid=abc" to the URL.

Thanks,
Mike

cybertoast
Champ in-the-making
Champ in-the-making
Thanks much. The only problem is that testing webscripts from the /share/service/ link is very convenient before having to enable them within, say a share dashboard and waiting for errors. Is there a recommended way to test webscripts to ensure they don't cause ugly errors on deployment?

mikeh
Star Contributor
Star Contributor
A number of ways:
1 - via /share/service as you're doing. This won't work for scripts that require authenticated access to the Repository however
2 - create your own, mostly empty, template with the dashlet on
3 - create a test Share site and remove all other dashlets (you can even remove all other pages if you like)

Thanks,
Mike