cancel
Showing results for 
Search instead for 
Did you mean: 

TypeError: Alfresco.FormUI is not a constructor ???

yascorp
Champ in-the-making
Champ in-the-making
I'm struggling for many days to display my popUp on my dashlet & I got this error in the "simple-dialog.js"

TypeError: Alfresco.FormUI is not a constructor

PLEASE HELP ME to resolve it

Thnx & regards
4 REPLIES 4

afaust
Legendary Innovator
Legendary Innovator
Hello,

have you made sure that the form JS / CSS dependencies have been properly included / loaded where you want to use the simple-dialog? In my experience, this is typically a symptom of using simple-dialog to display a form when the dependencies are not available. simple-dialog itself works fine without the form dependencies as long as you do not call the /share/service/components/form web script to populate its HTML.

Regards
Axel

yascorp
Champ in-the-making
Champ in-the-making
Thanks for your fast answer !

I have include all the dependencies I used in my head.ftl

<javascript>
<#include "../component.head.inc">
<#include "../form/form.get.head.ftl">

<!– Simple Dialog –>
<@script type="text/javascript" src="${page.url.context}/res/modules/simple-dialog.js"></@script>

<!– file-upload –>
<@script type="text/javascript" src="${page.url.context}/res/components/upload/file-upload.js"></@script>

<!– Resize –>
<@script type="text/javascript" src="${page.url.context}/res/yui/resize/resize.js"></@script>

<!– list-news  –>
<@link rel="stylesheet" type="text/css" href="${page.url.context}/res/components/dashlets/list-news.css" />
<@script type="text/javascript" src="${page.url.context}/res/components/dashlets/list-news.js"></@script>
</javascript>

You think my head.ftl isn't complete ?!
Thanks & Regards

afaust
Legendary Innovator
Legendary Innovator
Hello,

unfortunately, the form.get.head.ftl is useless (empty) in Alfresco 4.2, so you actually have not included the necessary dependencies anymore. You should adapt any custom component to the new style of web scripts that no longer have a .head.ftl - especially if you want to use the Forms API. Then you can include the new file form.dependencies.inc which contains all the relevant imports. There are also form.css.ftl and form.js.ftl with (about) the same dependencies - I am not sure which one will stay with us in the long run though.

Regards
Axel

yascorp
Champ in-the-making
Champ in-the-making
Thank's Axel for your reply, so I'm gonna try to learn much more about this approach !
Regards