cancel
Showing results for 
Search instead for 
Did you mean: 

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

tansadio
Confirmed Champ
Confirmed Champ

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 ACCEPTED ANSWER

afaust
Legendary Innovator
Legendary Innovator

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.

View answer in original post

3 REPLIES 3

afaust
Legendary Innovator
Legendary Innovator

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
World-Class Innovator
World-Class Innovator

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).

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

Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.