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

Avatar

Avatar

rampai

Avatar

rampai

rampai

08-08-2019

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.

View Entire Topic

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831
Arun_Patidar
MVP

08-08-2019

Hi,

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

like params.newValue['value1']