Alfresco Aikau Widgets on share-header.get.js

cancel
Showing results for 
Search instead for 
Did you mean: 
gawel
Active Member II

Alfresco Aikau Widgets on share-header.get.js

Hi,

Component Alfresco Aikau Widgets seen doen'st work on share-header-get.js (Select list is empty and no error)

code :

var siteService = widgetUtils.findObject(model.jsonModel, "id", "SITE_SERVICE");

if (siteService && siteService.config) {

    // #################################################
    // ### customize site popup
    // #################################################
    siteService.config.widgetsForCreateSiteDialogOverrides = [
  
    // call webscript for listbox
    {

        id : "site-departement",
        name : "alfresco/forms/controls/Select",
        // name : "alfresco/forms/controls/MultiSelectInput",
        targetPosition : "BEFORE",
        targetId : "CREATE_SITE_FIELD_TITLE",
        config : {
            fieldId : "site-departement",
            label : "label here",
            name : "departement",
            description : "comment here",

            optionsConfig : {
                queryAttribute : "shortName",
                publishTopic : "ALF_GET_FORM_CONTROL_OPTIONS",
                publishPayload : {
                    url : page.url.context + "/proxy/alfresco/api/groups/ALFRESCO_ADMINISTRATORS/children",
                    resultsProperty : "options",
                    itemsAttribute : "data",
                    labelAttribute : "displayName",
                    valueAttribute : "shortName"
                }

            }
        }

    }

    ];

}

The list box keep empty. The only error i found is on client side : "TypeError: this.options is null" (need to active debug on alfresco share).

Have you any idea?

thx

1 Reply
gawel
Active Member II

Re: Alfresco Aikau Widgets on share-header.get.js

I tried another ways and this code doesn't work too :

var conn2 = remote.connect("alfresco");
var repoResponse2 = conn2.get("/xx/site/departement");
var jsonResponse = JSON.stringify(eval("(" + repoResponse2 + ")"));

where jsonResponse equals :

[{"label":"DEP1","value":"01"},{"label":"DEP2","value":"02"},...]

And AIKAU component :

{
     id : "CREATE_SITE_FIELD_DEPARTEMENT",
     name : "alfresco/forms/controls/Select",
     targetPosition : "BEFORE",
     targetId : "CREATE_SITE_FIELD_TITLE",
     config : {
     fieldId : "CREATE_SITE_FIELD_DEPARTEMENT",
     label : "Département du site",
     name : "departement",
     optionsConfig : {
     fixed : jsonResponse
     }

}

And... ListBox is empty...

If i replace optionsConfig by :

optionsConfig : {
     fixed : [ {
     label : "Red",
     value : "RED"
     }, {
     label : "Green",
     value : "GREEN"
     }, {
     label : "Blue",
     value : "BLUE"
     } ]
     }

Listbox work...

Have you some issue for this bug?