AEMaaCS : dialog customization to support autofill of alt text from meta data description | Community
Skip to main content
New Participant
August 3, 2022
Solved

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

  • August 3, 2022
  • 2 replies
  • 1032 views

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.
Best answer by arunpatidar

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
}

})

2 replies

arunpatidar
arunpatidarAccepted solution
New Participant
August 4, 2022

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
New Participant
August 4, 2022

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>

  

 

arunpatidar
New Participant
August 4, 2022

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

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

Arun Patidar
New Participant
August 4, 2022

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