Post Request

Showing results for 
Search instead for 
Did you mean: 
Active Member

Post Request

I made this model 

      <type name="sp:configuration">
                  <property name="sp:username">
                  <property name="sp:users">

I' m trying to make a form in which a user can choose a list of users, I tried this code in the js file of the new page

ConfigurationFormWidget = [
      name : "alfresco/forms/controls/MultiSelectInput",
      config : {
            label : "Select Users",
            name : "prop_config_users",
            optionsConfig : {
                  queryAttribute : "shortName",
                  publishTopic : "ALF_GET_FORM_CONTROL_OPTIONS",
                  publishPayload : {
                        url : page.url.context
                        + "api/groups/ALFRESCO_ADMINISTRATORS/children",
                  resultsProperty : "options",
                  itemsAttribute : "data",
                  labelAttribute : "displayName",
                  valueAttribute : "shortName"

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: "/hdp/ws/configUserSpace",
                 //To create the folder under document library, we need the documberLibrary nodeRef,So POST that too.
      widgets: ConfigurationFormWidget


the issue is that the users are not being displayed in the MultiSelectInput, and I didn't find the URI to display all users not only ALFRESCO_ADMINISTRATORS.

Finally how can I make the POST request to send the data and save it in contents?

1 Reply
Active Member

Re: Post Request

How can I change this code to make the alfDestination variable equal to companyHome , is it possible ?

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; }