Description
Bug Report
Current Behavior
Some components retrieve the component id from its corresponding sling model (i.e The accordion component) while others explicitly initialize an instance of the Component model (i.e. The button component). This last initialization is unnecessary (as all component's sling models inherit and implement the main Component model).
Expected behavior/code
All components should retrieve the Component's ID directly from its corresponding sling model, no further initialization is needed.
Environment
- NA
Possible Solution
I would like to have all the initialization and calls to the general component model replaced with a call to the specific component model for each model.
Additional context / Screenshots
Example:
Given the existing Button HTL code
<button data-sly-use.button="com.adobe.cq.wcm.core.components.models.Button"
data-sly-use.component="com.adobe.cq.wcm.core.components.models.Component"
....
id="${component.id}"
We'd do a replacement with the following code instead
<button data-sly-use.button="com.adobe.cq.wcm.core.components.models.Button"
...
id="${button.id}"