AEMaaCS : dialog customization to support autofill of alt text from meta data description | Community
Skip to main content
Level 4
Aug 3, 2022 5:09 PM UTC
Solved

AEMaaCS : dialog customization to support autofill of alt text from meta data description

Hi Experts,

 

I have pathfield with picker= /mnt/overlay/dam/cfm/admin/content/v2/associated-content/assetpicker.html?root=/content/dam&mode=single&filter=nosystem for selecting path for image.

 

We have Alt Text field as well for the image, so requirment is to auto fill alt text field with meta description of the selected image. something similar already exists in OOTB image cmp but not able to reuse it as our component dialog structure involves multiple tabs with multiple pathfields selectors in each tab.

 

can you please give some direction here.

 

Thanks

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Aug 4, 2022 7:04 AM UTC

Make an ajax request to assets metadata node on change to get metadata 

 

$('pathfield-selector').on('change', function(){

$.get(assetsPath + /metadata.1.json, function( data ) {
//set descript inout from dc:description
}

})

Arun Patidar

6 replies

arunpatidar
arunpatidarAccepted solution
New Participant
Aug 4, 2022 7:04 AM UTC

Make an ajax request to assets metadata node on change to get metadata 

 

$('pathfield-selector').on('change', function(){

$.get(assetsPath + /metadata.1.json, function( data ) {
//set descript inout from dc:description
}

})

Translate
Arun Patidar
Level 4
Aug 4, 2022 12:00 PM UTC

Thanks for the reply @arunpatidar 

but It is not working for pathfield.

on change function is not working for pathfiled but it works for normal text field .

Becuase in normal text field , input tag has value attribute but for pathfiled .

Input is not having any vlaue tag , I can see the value is there in down below inside coral-taglist.

like below:

<coral-taglist>

  <coral-tag>

    <coral-tag-label></coral-tag-label>

    <input type="hidden" handle="input" name="./asset" value="xyz">

 </coral-tag>

</coral-taglist>

  

 

Translate
arunpatidar
New Participant
Aug 4, 2022 2:08 PM UTC

Why are you using tag fields? instead of normal input field?

You setup pathfield as multi-select, change it to 1.

Translate
Arun Patidar
Level 4
Aug 4, 2022 5:08 AM UTC

@arunpatidar  @santoshsai  @sachin_arora_ @lukasz-m  need your input here. Please do respond.

Translate