AnsweredAssumed Answered

Aikau Simple Form Example

Question asked by muralidharand on Mar 7, 2015
Latest reply on Mar 29, 2015 by satheeshkumar
Hi All,
I created a very simple aikau form example.

/* Here is the code of  student-form.get.js   */

This page is used to render a simple form and POST the data to repository,
to create a new student folder under Document Library.
The Student model in described here ……..
Import the student model as described here….

/* get the current site */
var site =;
//Read the node reference of Document Library
var alfDestination = null;
var result ="/slingshot/doclib/container/"+site+"/documentLibrary");
if (result.status.code == status.STATUS_OK)
   alfDestination = JSON.parse(result).container.nodeRef;

//Create the form control for the student
var studentFormWidget = [     
      name: "alfresco/forms/controls/DojoValidationTextBox",
      config: {
     label: "Student ID",
     name: "prop_student_StudentID"
      name: "alfresco/forms/controls/DojoValidationTextBox",
      config: {
     label: "First Name",
     name: "prop_student_firstName"
      name: "alfresco/forms/controls/DojoValidationTextBox",
      config: {
     label: "Last Name",
     name: "prop_student_lastName"    
      name: "alfresco/forms/controls/DojoValidationTextBox",
      config: {
     label: "Email",
     name: "prop_student_email"


//Create the form here
var form = {
   name: "alfresco/forms/Form",
   config: {
      showOkButton: true,
      okButtonLabel: "Save",  
      showCancelButton: false,
      cancelButtonLabel: "",
   //Specify the TOPIC here
      okButtonPublishTopic: "ALF_CRUD_CREATE",
      okButtonPublishGlobal: true,  
   okButtonPublishPayload: {
  //Specify the URL here to POST the data
        url: "api/type/student%3AstudentFolder/formprocessor",
  //To create the folder under document library, we need the documberLibrary nodeRer,So POST that too.
     widgets: studentFormWidget

//Add the form and services to the JSON MODEL
model.jsonModel = { widgets: [ form ],   services: ["alfresco/services/CrudService"] };

/* Details of   student-form.get.desc.xml   */
  <shortname>Student Form Example</shortname>

/*   student-form.get.html.ftl   */
<@processJsonModel group="share"/>