Is it possible to have parameterized function calls in AEM Use API? | Community
Skip to main content
rampai
Level 1
Aug 8, 2019 10:40 AM UTC
Solved

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

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.
arunpatidar
arunpatidarAccepted solution
New Participant
Aug 8, 2019 2:57 PM UTC

Hi,

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

like params.newValue['value1']

Arun Patidar

1 reply

arunpatidar
arunpatidarAccepted solution
New Participant
Aug 8, 2019 2:57 PM UTC

Hi,

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

like params.newValue['value1']

Translate
Arun Patidar