Skip to main content
Level 9
Jun 8, 2016 12:01 PM UTC
Solved

Limit pathfield to 1 inside a multifield

Hi All,

In my dialog.xml, we have the below :

 <multi
                        jcr:primaryType="cq:Widget"
                        fieldLabel="Page Path"
                        name="./relatedPath"
                        xtype="multifield">
                        <fieldConfig
                            jcr:primaryType="nt:unstructured"
                            xtype="pathfield"/>
                    </multi>

#1]We should be able to restrict the pathfield we can choose to 1 here. 

Any reference/snippet/thoughts on this will be really helpful.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
leeaslingAccepted solution
Level 8
Jun 9, 2016 6:03 PM UTC

if you only want to allow 1 path to be chosen, don't put the path field in a mutlfield.  Just have it be a pathfield.

<relatedPage jcr:primaryType="cq:Widget" fieldLabel="Page Path" name="./relatedPath" xtype="pathfield"> </relatedPage>

No need to over complicate.

4 replies

Level 4
Jun 8, 2016 12:55 PM UTC

I am not clear in what you are looking for. Seem you want to know how to restrict a path field values where the path field is used in a multi-field control. 

Translate
askdctmAuthor
Level 9
Jun 9, 2016 5:24 PM UTC
leeaslingAccepted solution
Level 8
Jun 9, 2016 6:03 PM UTC

if you only want to allow 1 path to be chosen, don't put the path field in a mutlfield.  Just have it be a pathfield.

<relatedPage jcr:primaryType="cq:Widget" fieldLabel="Page Path" name="./relatedPath" xtype="pathfield"> </relatedPage>

No need to over complicate.

Translate
Lokesh_Shivalingaiah
Level 10
Jun 9, 2016 6:58 PM UTC

I agree with @leaasling. Keep the path field out of the multifield so you dont have to put the extra 'limitation' to it.

Translate