Metadata schema changes | Community
Skip to main content
seenivasaragava
Level 2
October 16, 2015
Solved

Metadata schema changes

Hi

I want to enable / disable the fields on metadata editor page. For example i should have 1 dropdown and 3 text boxes. If i select yes value from the first drop down then i have to hide or disable the 3 text boxes. If i select no then i should enable those again. Please help me to do this.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
ogillAccepted solution
Employee
October 16, 2015

The link below covers your topic and many more with example code:

https://docs.adobe.com/docs/en/aem/6-0/develop/components/widgets.html

7 replies

ogillAccepted solution
Employee
October 16, 2015

The link below covers your topic and many more with example code:

https://docs.adobe.com/docs/en/aem/6-0/develop/components/widgets.html

Translate
seenivasaragava
Level 2
October 16, 2015

First of all thanks for your response. I gone through link and It is look like a classic UI or wcm part. But i am talking about coral UI. We will add / change the metadata nodes under metadata schema editor page ryt that one.

Translate
Level 4
October 16, 2015

Please check /libs/dam/gui/components/admin/propertiesform/clientlibs/propertieseditor/js/propertieseditor.js

Translate
seenivasaragava
Level 2
October 16, 2015

The mentioned above js getting called but what can we do with that.pls guide me. I am new to cq5.

Translate
Level 4
October 16, 2015

Well , you need to write logic in this js file for hide/show . Try something like below :

var yourFields = $('[name="./jcr:content/metadata/yourfiledname"]');
 yourFields .each(function(index, value) {                       
                        var $value = $(value);

                          for(var i = 0; i< yourFields .length;i++){
                                           
                                            $value.addClass('hide');
                                          
                                        }
                    });

Translate
seenivasaragava
Level 2
October 16, 2015

thanks i will try this. Also please help me to write selection change function for the dropdown which is in the metadata properties page.

Translate
seenivasaragava
Level 2
October 16, 2015

See below my fields are like this. I have attached UI and html.   Also I have tried with the above code you have provided.  Here I am getting myFields as object. I am unable to read that. Also the alert "Inside" is not getting displayed(not going inside for each loop)

    var myFields = $('[name="./jcr:content/metadata/myProperty"]');
    alert(myFields);
 myFields.each(function(index, value) { 
    alert("Inside");
                        var $value = $(value);
                         for(var i = 0; i< yourFields .length;i++){

                                           $value.addClass('hide');

                                       }
                    });

 

Please help me to do this.Thanks in advance.

Translate