AnsweredAssumed Answered

Aikau add options to a select form control

Question asked by nancygaillard on Jun 16, 2015
Latest reply on Aug 11, 2015 by nancygaillard
Hi,

I am working with Alfresco 5.0.d and Alfresco SDK 2.0. And I am French

I am testing creating a page with a form, modifying the controller of the "simple-page" page of a new share project.

My main problem is that I don't see how to add options to a select form control. When I run my project, i am able to see the select but it is empty.

Other problem :
I have seen this tutorial https://blogs.alfresco.com/wp/developer/2014/09/26/aikau-mini-examples-simple-form/
And looking at https://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/COMMUNITYTAGS/V4.2f/root/projects/slingshot/source/web/js/alfresco/forms/controls/
on the BaseFormControl.js and DojoSelect.js

but I can't find the equivalent for V5.0.d

There is my example :
<blockcode>
var select = "alfresco/forms/controls/DojoSelect";

var form = {
   name: "alfresco/forms/Form",
   config: {
      showOkButton: true,
      okButtonLabel: "Filtrer",
      showCancelButton: true,
      cancelButtonLabel: "Annuler",
     postUrl:"/share/page/dp/ws/simple-page",
      okButtonPublishTopic: "PUBLISH_TOPIC",
      okButtonPublishGlobal: true,
      widgets: []
   }
};
var tailleTc = {
   name: select,
   config: {
      fieldId:"TAILLETC",
      name:"tailletc",
      label: "Taille TC",
      description: "Taille du TC",
      widgets:[
         {
            value:"40",
            options : [
               { label: "40", value: "40"},
               { label: "20", value: "20"},
               { label: "Autre", value: "0"}
            ]
         }
      ]
   }
};
form.config.widgets.push(tailleTc);
model.jsonModel = {
   widgets: [
      form
   ]
};
</blockcode>

Outcomes