AnsweredAssumed Answered

Aikau internationalization (i18n) not working when loading widget as a control with form engine

Question asked by iblanco on Jul 10, 2014
Latest reply on Jul 10, 2014 by iblanco
Hello,

I'm developing a custom page that uses the form engine javascript api to render a form. I need a custom control in this form so I'm developing it using Dojo and the new Aikau framework. Everything seems to work as expected except that internationalization messages aren't being loaded properly.

Debuging with firebug I managed to spot that the different message scopes defined by the widget are loaded into Alfresco.messages by a dinamically generated resource url, but my widget's scope is not there.

I suppose this is because my widget is not processed through "<@processJsonModel group="share"/>", is not instantiated by Share's webscript backend. It is loaded as part of a form and is instantiated by my control.

So, does this mean that the i18n loading features of Aiku can not be used in controls?

Or maybe I should build my widget in a differente way? This is how my control builds the widget:


<script type="text/javascript">//<![CDATA[
require(["custom/controls/OrderedUserList"], function (OrderedUserList) {
    var config = {};
    <#if form.mode == "edit">
    config.nodeRef = "${form.arguments.itemId}";
    </#if>
    <#if field.control.params.reorder??>
    config.reorder = ${field.control.params.reorder?string};
    </#if>
    <#if field.control.params.type??>
    config.type = "${field.control.params.type}";
    </#if>
    var orderedUserList = new OrderedUserList(config, "${fieldHtmlId}-widget");
});
//]]></script>
<div id="${fieldHtmlId}-widget">
</div>
<input id="${fieldHtmlId}" type="hidden" value="">


Thanks

Outcomes