Highlighted

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

Avatar

Avatar

shreeshan94

Avatar

shreeshan94

shreeshan94

30-11-2017

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?

Replies

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

30-11-2017

Highlighted

Avatar

Avatar

edubey

Total Posts

1.5K

Likes

264

Correct Answer

392

Avatar

edubey

Total Posts

1.5K

Likes

264

Correct Answer

392
edubey

30-11-2017

Highlighted

Avatar

Avatar

shreeshan94

Avatar

shreeshan94

shreeshan94

30-11-2017

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

Highlighted

Avatar

Avatar

Techaspect_Solu

Avatar

Techaspect_Solu

Techaspect_Solu

30-11-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