Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Make pathfield inside multifield mandatory[* to appear against field name in component dialog]

Avatar

Level 9

Hi All,

The dialog structure  I am having is as below:

<multi
                        jcr:primaryType="cq:Widget"
                        fieldDescription=""
                        fieldLabel="label"
            itemId="Field"
                        name="./Path"
                        xtype="multifield">
                        <fieldConfig
                            jcr:primaryType="nt:unstructured"
                            allowBlank="false"
                            limit="{Long}2"
                            xtype="pathfield"/>
                    </multi>

#1] Giving allowBlank="false" in the above doesnt show up * against the field in component dialog.

#2] Tried adding in section for multifield only, but did not help.

#3] Added in both places[in above dialog representation present only at pathfield] , but * doesnt show up against field in component dialog.

Not sure what I am missing. Any thoughts/pointers on this will be helpful.

5 Replies

Avatar

Level 10

allowBlank = false will just enable the null check validation. I dont think '*' would appear on the field automatically. We can add '*' along with our label or add a 'description' to the field.

However Let me check if its possible

Avatar

Level 9

Hi Lokesh,

Thank you for your reply.

Awaiting your response.

Avatar

Administrator

Hi 

As mentioned by Lokesh, "allowBlank = false" only do NULL check.

For adding "*" to indicate it as required field, you can add it in fieldLabel only [Just a Workaround].  I am also waiting for Lokesh to tell me the correct way.

 

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Hi,

In classic UI, "allowBlank=false" doesnt add '*' automatically. 

However in Touch UI if you can use  "required=true" which adds '*' by default. So your use case works OOB in Touch UI.

Hi Lokesh,

It seems required=true is not adding '*' by default.