Is it possible to have parameterized function calls in AEM Use API? | Community
Skip to main content
rampai
Community Advisor
Community Advisor
August 8, 2019
Solved

Is it possible to have parameterized function calls in AEM Use API?

  • August 8, 2019
  • 1 reply
  • 1372 views

I have seen parameters being passed to the Use API while invoking the same in HTL.

e.g.

<div data-sly-use.params="${'params.js' @ value1='feike', value2='visser', seperator=' '}">

  ${params.newValue}

</div>

Is it possible to pass parameters to the Use API function call instead of the API invocation itself?

e.g.

<div data-sly-use.params="${params.js}">

       ${params.newValue @ value1='feike', value2='visser', seperator=' '}

       ${params.newValue @ value1='firstname', value2='lastname', seperator=' '}

</div>

That way we can initialize the use api once and call functions with multiple params in code.

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

Hi,

I don't think, it is possible. Though you can get map value by passing keys

like params.newValue['value1']

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
August 8, 2019

Hi,

I don't think, it is possible. Though you can get map value by passing keys

like params.newValue['value1']

Arun Patidar