cancel
Showing results for 
Search instead for 
Did you mean: 

aikau - AlfList in dialog

nancygaillard
Champ on-the-rise
Champ on-the-rise
Hello,

I would know how can I have an AlfList in a dialog?
I tried this simple test, but it doesn't work …

The original test was a a click on a propertylink (in a alfList) which would generate a dialog which would contain a list - (precision if I have to do something different)
The problem is that the worth I obtain is a simple dialog, and the best a dialog with an error explaining a difficulty to render the view (sorry I am French)

I have seen https://github.com/Alfresco/Aikau/blob/master/tutorial/chapters/Tutorial8.md but I imagine I don't understand someting… So, some help would be welcome!

<blockcode>
model.jsonModel = {
  services: [
   "alfresco/services/CrudService",
   "alfresco/services/DialogService",
  ],
  widgets: [
   {
      name: "alfresco/buttons/AlfButton",
      config:{
         label:" Show groups",
         publishTopic: "ALF_CREATE_DIALOG_REQUEST",
         publishPayload: {
            dialogTitle: "Groups",
            widgetsContents:[
               {
                  name: "alfresco/lists/AlfList",
                  waitForPageWidgets: false,
                  loadDataPublishTopic: "ALF_CRUD_GET_ALL",
                  loadDataPublishPayload: {
                     url: "api/groups"
                  },
                  config:{
                     widgets:[{
                        name: "alfresco/lists/views/AlfList",
                        config:{
                           widgets:[{
                              name:"alfresco/lists/views/AlfListView",
                              config:{
                                 widgets:[{
                                    name: "alfresco/lists/views/layouts/Row",
                                    config:{
                                       widgets:[{
                                          name:"alfresco/lists/views/layouts/Cell",
                                          config:{
                                             widgets:[{
                                                name: "alfresco/renderers/Property",
                                                config:{
                                                   propertyToRender: "displayName"
                                                }
                                             }]
                                          }
                                       }]
                                    }
                                 }]
                              }
                           }]
                           
                        }
                     }]
                  }
               }
            ]
         }
      }
   }
  ]
};
</blockcode>
4 REPLIES 4

nancygaillard
Champ on-the-rise
Champ on-the-rise
any idea?
(Windows Server 2008 R2 and Windows 7, Aikau 1.0.8.1)

nancygaillard
Champ on-the-rise
Champ on-the-rise
In my example, I have some mistakes :
I wrote "widgetsContents", but the good attribute is "widgetsContent" (http://dev.alfresco.com/resource/docs/aikau-jsdoc/DialogService.html)
I forgot the itemsProperty which has to be near name: "alfresco/lists/AlfList".

I tested to add the last version of aikau (the 1.0.31) in my project (path : project>/target/conteneurs-share-war/WEB-INF/lib) and done a command "mvn install -Pamp-to-war -DskipTests=true" but nothing changed…

ddraper
World-Class Innovator
World-Class Innovator
It looks like you've got an AlfList immeidately inside another AlfList - that's not going to work. Also, as you've also pointed out you need to set the "itemsProperty" because the REST API you've called uses the attribute "data" and not "items" (which is the default) to reference the array of groups.

nancygaillard
Champ on-the-rise
Champ on-the-rise
I succeed resolve my problem Smiley Happy

This part would be in the "config" and not before!!
<blockcode>
waitForPageWidgets: false,
loadDataPublishTopic: "ALF_CRUD_GET_ALL",
loadDataPublishPayload: {
   url: "api/groups"
},
itemsProperty: "data",
</blockcode>

There is the good code Smiley Happy (with some changes due to my tests)

<blockcode>
var liste = {
   name: "alfresco/lists/AlfList",
   config:{
      waitForPageWidgets: false,
      loadDataPublishTopic: "ALF_CRUD_GET_ALL",
      loadDataPublishPayload: {
         url: "api/groups"
      },
      itemsProperty: "data",
      widgets:[{
         name:"alfresco/lists/views/AlfListView",
         config:{
            widgets:[{
               name: "alfresco/lists/views/layouts/Row",
               config:{
                  widgets:[{
                     name:"alfresco/lists/views/layouts/Cell",
                     config:{
                        widgets:[{
                           name: "alfresco/renderers/Property",
                           config:{
                              propertyToRender: "displayName"
                           }
                        }]
                     }
                  }]
               }
            }]
         }
      }]
   }
};

var button = {
      name: "alfresco/buttons/AlfButton",
      config:{
         label:" Show groups",
         publishTopic: "ALF_CREATE_DIALOG_REQUEST",
         publishPayload: {
            dialogTitle: "Groups",
            widgetsContent:[
               liste
            ]
         }
      }
   };


model.jsonModel = {
  services: [
   "alfresco/services/CrudService",
   "alfresco/services/DialogService",
  ],
  widgets: [
   button
  ]
};
</blockcode>