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

Experience Fragment Variation Page Create Button is Not Enabled.

Avatar

Level 2

While creating Experience Fragment Variation Page facing 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

 

Is there any event listeners that calls before AEM validation ?

or Any Idea to solve this Issue?

Thanks In Advance .

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
1 Reply

Avatar

Correct answer by
Community Advisor