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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

aem6.5 Adaptive form text field component dynamic setting using guidebridge the displayPictureClause and validatePictureClauseMessage

Avatar

Level 1

Hello,

 

I have a text field component and need to change the validation dynamically based on selection drop down.

 

Could you please provide inputs as how to resolve it.

 

I . We can get the component details using guidebridge using 

let text_component =guideBridge.resolveNode("text_input_component");

 

2.noticed that  displayPictureClause is used for validation.

How to set it

I can get the current value set by doing 

 

text_component.displayPictureClause

 

But my requirement is I would want to set it dynamically.

 

by doing text_component.displayPictureClause="regex expression"

 

does not work.

 

3> I would want to set the validatePictureClauseMessage also dynamically

 

 

3 Replies

Avatar

Employee

I don’t think there is any documented way of doing that

Avatar

Level 1

Thanks for the input. If you could suggest any other way I could do it.

 

As I need to do validation dynamically based on selection.

 

so new selection value , new validation must be applied on the same text field form component.

 

Thanks

Avatar

Level 1

Any input as how could I do it 

 

I was trying using rule editor  using validate function.

 

But AEM ootb is always writing a custom message .How to overcome it

 

let testing=$('#component___widget_desc');
console.log("the testing="+testing.text()); // it prints the current error msg if set
testing.text("errror show");// this does not get wrtten ,always aem based OOTB error msg displayed how to over come this.
false

 

Srinivas_Opti_0-1679304728824.png

 

Srinivas_Opti_1-1679304775244.png

 

 

 

How to write the custom error msg instead of aem OOTB msg

 

 

 

 

Thanks