내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Ajax call to USE-API script

Avatar

Level 2

I have an RTE in my dialog with a link plugin, that would update some values data-foo & data-bar and store them along as part of the anchor tag in a property on save. data-foo and data-bar are completely dependent upon the href value mentioned by user in the link dialog. To generate both the values, I have a logic built using a use-api script that has access to the ResourceResolver and Externalizer classes. Is it possible for us to send an ajax call or any other request to the server with the href value as argument from the dialog.

주제

토픽은 커뮤니티 콘텐츠를 분류하여 관련성 있는 콘텐츠를 찾는 데 도움이 됩니다.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Community Advisor
5 답변 개

Avatar

정확한 답변 작성자:
Community Advisor

Avatar

Level 2
@arunpatidar but the use api script i've mentioned in is a javascript use api script. It also accepts some values as arguments. is it possible to execute this javascript use api script from a servlet then?

Avatar

Employee Advisor

@PremIB  Did you try to make this ajax call from the same use-api script where you're creating data-foo & data-bar? That should have the href value already.

Avatar

Level 2
@shelly-goel I do not understand why I should be making a call from the use-api script again to the same script. My intention here is to call the backend script from frontend javascript. is it possible?

Avatar

Employee Advisor
@PremIB - Yes you would be able to make an ajax call to a servlet at server side but not the Java use-api (I initially understood that you're using javascript use-api). The other option is you can get the richtext using getProperties().get("title", "") in the wcmusepojo extension and then parse it for all the href in it. Otherwise using javascript use-api could be an option too.