Get property value from AlflistView don't work in a widget Checkbox

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

Get property value from AlflistView don't work in a widget Checkbox

Jump to solution

Hi,

I would like to get property value form AlfListWiev in a widget Checkbox.

Example:

{

         name: "alfresco/lists/views/AlfListView",

         config:

         {

               currentData: {

                    items: [ { value: "true"}, { value: "false"} ]

               },

               additionalCssClasses: "bordered",

               widgetsForHeader:

               [{

                    name: "alfresco/lists/views/layouts/HeaderCell",

                    config:

                    {

                    additionalCssClasses: "mediumpad",

                    abel: "title.refInvoice"

               }]

               widgets:

               [{

                         name: "alfresco/lists/views/layouts/Cell",

                         config:

                         {

                                  additionalCssClasses: "mediumpad",

                                  widgets:

                                  [{

                                       name: "alfresco/forms/controls/CheckBox",

                                       config:

                                       {

                                            fieldId: "SHOW",

                                            name: "showValue",

                                           value: "value"

                                      }

                               }]

                         }

               }]

}

I need your help. Thnks for advance

1 Solution

Accepted Solutions
afaust
Master

Re: Get property value from AlflistView don't work in a widget Checkbox

Jump to solution

The CheckBox is a form control and usually not used for rendering data in a table-like structure. As such it does not support getting the value from the current list item on its own. For display purposes you may use the alfresco/renderers/Boolean widget.

3 Replies
afaust
Master

Re: Get property value from AlflistView don't work in a widget Checkbox

Jump to solution

The CheckBox is a form control and usually not used for rendering data in a table-like structure. As such it does not support getting the value from the current list item on its own. For display purposes you may use the alfresco/renderers/Boolean widget.

ddraper
Intermediate

Re: Get property value from AlflistView don't work in a widget Checkbox

Jump to solution

I just want to elaborate on Axel Faust​'s answer which is correct... everything in the "alfresco/renderers" package is broadly for use within an AlfListView​ widget. The idea is that the AlfList​ retrieves multiple items that are then iterated over and the model provided for the AlfListView​ is re-rendered for each item. So as suggested the Boolean​ renderer is the best widget for showing true/false data (if you review the linked JSDoc you'll see example of how it can be configured to work with different data values). This tutorial chapter covers the basic concepts.

The Checkbox​ widget is for rendering a single property of form data and is intended to be used within a Form​ widget. This tutorial chapter covers basic form configuration (within the context of a dialog)

The cross-over between the list and form approaches meets with the InlineEditProperty​ - this is a renderer which has an edit mode that contains a form with a form control for the property being edited. The InlineEditProperty renders a TextBox and the InlineEditSelect​ (which extends it) renders a Select. You could create a custom widget that extends InlineEditProperty to render a Checkbox form control (if you want to provide inline editing of boolean data).

tansadio
Active Member II

Re: Get property value from AlflistView don't work in a widget Checkbox

Jump to solution

Thnks a lot  Dave DraperAxel Faust, Your answer was most helpful