How to restrict the number of items added in a dialog which has a multifield? | Community
Skip to main content
sbg19
Level 2
November 30, 2017

How to restrict the number of items added in a dialog which has a multifield?

  • November 30, 2017
  • 3 replies
  • 2093 views

Current code is as below in my dialog.xml;

  

                          <field1

                                    jcr:primaryType="cq:Widget"

                                    name="./Field1"

                                    id="field1"

                                    fieldLabel="Field1"

                                    xtype="multifield">

                                  <fieldConfig

                                                jcr:primaryType="cq:Widget"

                                                xtype="compoundfield">    

                                    <items

                                                   jcr:primaryType="cq:WidgetCollection">

                                                   <subField1

                                                          jcr:primaryType="cq:Widget"

                                                          fieldLabel="subField1"

                                                          name="./subField1"

                                                          xtype="textfield"/>

                                                  <subField2

                                                           jcr:primaryType="cq:Widget"

                                                           fieldLabel="subField1"

                                                           name="./subField1"

                                                           xtype="textfield"/>

                                   </items>

                               </fieldConfig>

                        </field1>

Let's say I want to restrict the number of times I add the item in the dialog, what are the necessary changes to be made?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

smacdonald2008
Level 10
November 30, 2017
sbg19
sbg19Author
Level 2
December 1, 2017

Does this work for classic UI as well?
because we use an IDE to code and build it using Maven.

edubey
Level 10
November 30, 2017
Techaspect_Solu
Level 7
December 1, 2017

Hi,

Here is the article for classic UI:

http://experience-aem.blogspot.in/2016/01/aem-61-classic-ui-limit-multifield-widget.html

We've checked and it worked fine for us.

We hope this helps!

Regards,

TechAspect Solutions