cancel
Showing results for 
Search instead for 
Did you mean: 

How to load data using AlfListView after using some filter conditions?

satheeshkumar
Champ in-the-making
Champ in-the-making
Hi All,

I have created some filter conditions as shown in screen shot, which has some date constraints for (QA,UAT and PROD) and it also has some filter condition to filter some product types from the list.

I have created a post web script, to generate the response based on these filter conditions, after filtering I have generated the JSON response something like this,


{
  "deployProductInfoList": [
    {
      "deployToPROD": "Deploy",
      "deployToQA": "Already Deployed",
      "productCode": "BL1429872800",
      "deployToUAT": "Already Deployed"
    },
    {
      "deployToPROD": "Deploy",
      "deployToQA": "Already Deployed",
      "productCode": "BANS1429872793",
      "deployToUAT": "Already Deployed"
    },
    {
      "deployToPROD": "Already Deployed",
      "deployToQA": "Already Deployed",
      "productCode": "BV1429872804",
      "deployToUAT": "Already Deployed"
    },
    {
      "deployToPROD": "Already Deployed",
      "deployToQA": "Already Deployed",
      "productCode": "BA1429618431",
      "deployToUAT": "Already Deployed"
    },
    {
      "deployToPROD": "Not Eligible To Deploy",
      "deployToQA": "Already Deployed",
      "productCode": "BA1429872786",
      "deployToUAT": "Deploy"
    }
  ]
}


How to consume this response using ALfListView or whatever widget and show a table kind of structure, I couldn't find a way to consume this JSON response and show it in UI.

What I meant here is , if it is just a GET request, I can call the web script and populate it using AlfListView and show, but in this case it is not just a GET request, it's a POST request and I'll have to post some filter condition(dynamic filter conditions) before retrieving the JSON response as shown above.

Any help would be greatly appreciated.

Thanks in Advance,
4 REPLIES 4

vincent-kali
Star Contributor
Star Contributor
Using this kind of view should works…….


var myList = {
   name: "alfresco/lists/AlfList",
   config: {
      loadDataPublishTopic: "YOUR_TOPIC",
      sortField: "productCode",
      itemsProperty: "deployProductInfoList",
      widgets: [
      {
         name: "alfresco/lists/views/AlfListView",
         config: {
            widgetsForHeader: [
            {
               name: "alfresco/lists/views/layouts/HeaderCell",
               config: {
                  label: "deployToPROD"
               }
            },
            {
               name: "alfresco/lists/views/layouts/HeaderCell",
               config: {
                  label: "deployToQA"
               }
            },
            {
               name: "alfresco/lists/views/layouts/HeaderCell",
               config: {
                  label: "productCode"
               }
            },
            {
               name: "alfresco/lists/views/layouts/HeaderCell",
               config: {
                  label: "deployToUAT"
               }
            }               
            
            ],
            widgets: [
            {
               name: "alfresco/lists/views/layouts/Row",
               config: {
                  widgets: [
                  {      
                     name: "alfresco/lists/views/layouts/Cell",
                     config: {
                        widgets: [
                        {
                           name: "alfresco/renderers/Property",
                           config: {
                              propertyToRender: "deployToPROD"
                           }
                        }
                        ]
                     },
                     name: "alfresco/lists/views/layouts/Cell",
                     config: {
                        widgets: [
                        {
                           name: "alfresco/renderers/Property",
                           config: {
                              propertyToRender: "deployToQA"
                           }
                        }
                        ]
                     },
                     name: "alfresco/lists/views/layouts/Cell",
                     config: {
                        widgets: [
                        {
                           name: "alfresco/renderers/Property",
                           config: {
                              propertyToRender: "productCode"
                           }
                        }
                        ]
                     },
                     name: "alfresco/lists/views/layouts/Cell",
                     config: {
                        widgets: [
                        {
                           name: "alfresco/renderers/Property",
                           config: {
                              propertyToRender: "deployToUAT"
                           }
                        }
                        ]
                     }
                  }
               ]}
            }
….



VIncent

Hi Vincent,

I have tried the same kind of view you have shown. But the problem is , the topic
loadDataPublishTopic: "YOUR_TOPIC"
should make a post request and the data for the post request should come from the screen shot I have shown in my initial post,
I was not able to include the widgets(I have shown in the screen shot), in the service where I am subscribing the topic "YOUR_TOPIC".

Hi,
You should read this: https://github.com/Alfresco/Aikau/blob/master/tutorial/chapters/Tutorial7.md


specially "The  formSubmissionTopic  attribute configures the topic that is published when you click on the confirmation button of the dialog. The payload that is published will be an object containing all the values of the form controls against a key defined by the  name  attribute of each control."

nancygaillard
Champ on-the-rise
Champ on-the-rise
Finally what did you do?