Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Experience Fragment Variation Page Create Button is Not Enabled.

dhanubrp
Level 2
Level 2

While creating Experience Fragment Variation Page having validation issue.

 

In variation page I have 7 fields in that Field 1, 6 and 7 are mandatory fields

 

1.png

2.png


Field 6 is -> Tag Field (cq/gui/components/coral/common/form/tagfield)
Field 7 is -> Select Field (granite/ui/components/foundation/form/select)

 

Whenever I select Field 6 value , we are populating Field 7 value by default

The problem what I am facing is after selecting all the 3 field values "Create" button is not enabled

Reason for this

  

1) Once I select Field 6 Value immediately its calling validations.js from AEM libs

/libs/granite/ui/components/coral/foundation/clientlibs/foundation/js/native/validations.js

registry.register("foundation.validation.validator", {

selector: "input, textarea, select",
validate: function(element) {
}
});

This code is checking field 7 values is selected or not , based on values its returning true or false.


2) We have code to populate Field 7 values based on Field 6 value

$tagList.on('coral-collection:add', function (event) {
//code to select field 7 value based on field 6 value

});

 

3) Before calling our "coral-collection:add" function its calling AEM libs validation,
so by that time still field 7 value not selected so AEM libs method returning false .
After that our add method calling and selecting value for Field 7. Because of this "Create" button is not enabling

 

   First calling -> AEM validation method 

   Second Calling -> Customized method


Is there any event listeners that calls before AEM valdiation?

or Any Idea to solve this Issue?

 

Thanks In Advance .

1 Accepted Solution
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

hi,

I did not think you can change that without tweaking OOTB validation.js

But you can enable the create button from your code when everything(field 6 or 7 or may be others) is valid.

View solution in original post

1 Reply
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

hi,

I did not think you can change that without tweaking OOTB validation.js

But you can enable the create button from your code when everything(field 6 or 7 or may be others) is valid.

View solution in original post