Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to provide validation's existing content fragment models datatypes.

Avatar

Level 3

Hi team,

        How to provide validation's existing content fragment models datatypes.

         How to load clientlibs content fragment model page.

            I created Content Fragment Models,need to do validation's in existing datatypes.

39.PNG

Based existing datatypes created content fragment model page.

40.PNG

Regards

Kotireddy Naru

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

Ok, then you need to add clientlibs with category type of  dam.cfm.authoring.v2

$( document ).ready(function() {

    console.log( "inside CFM - ready!" );

    $("button.button-apply.editor-GlobalBar-item").click(function(){

        alert("clicked");

     })

});

Screenshot 2018-10-22 at 7.50.06 PM.png



Arun Patidar

View solution in original post

6 Replies

Avatar

Community Advisor

HI,

You can add validation clientlibs as cq.cfm.admin.models.formbuilder

you need to call that function to validate fields on onclick event of save button.



Arun Patidar

Avatar

Level 3

thanks Arun, providing info.

I am adding my validation's below js files.

/libs/dam/cfm/models/editor/components/formbuilder/clientlibs/js/field-properties.js

/libs/dam/cfm/models/editor/components/formbuilder/clientlibs/js/main.js

/libs/dam/cfm/models/editor/components/formbuilder/clientlibs/js/submit.js

       

those Javascript files not loaded properly in model page.

test.PNG

Thanks

Kotireddy Naru

Avatar

Community Advisor

Hi,

Can you check files in network tab or try to put log statement.

working for me.

Screenshot 2018-10-22 at 6.44.58 PM.pngScreenshot 2018-10-22 at 6.44.40 PM.png

Saved button event is also working

$( document ).ready(function() {

    console.log( "inside CFM - ready!" );

    $("button.foundation-wizard-control").click(function(){

     alert("save button clicked");

    })

});

Screenshot 2018-10-22 at 6.50.15 PM.png



Arun Patidar

Avatar

Level 3

thanks Arun,

     I dont need to validation's  Content Fragment Model Editor, need validation's  Content Fragment Model Page level

PFA

          test.PNG

Thanks

Kotireddy

Avatar

Correct answer by
Community Advisor

Hi,

Ok, then you need to add clientlibs with category type of  dam.cfm.authoring.v2

$( document ).ready(function() {

    console.log( "inside CFM - ready!" );

    $("button.button-apply.editor-GlobalBar-item").click(function(){

        alert("clicked");

     })

});

Screenshot 2018-10-22 at 7.50.06 PM.png



Arun Patidar