79576841

Date: 2025-04-16 09:40:08
Score: 0.5
Natty:
Report link

This is because the "each" variable from EL is only available during the component creation phase,

While data binding is parsed during the event phase, meaning that EL variables like "each" are not accessible at that time.

If you want to differentiate each button's calling, please change to use <forEach> component and create a common command like @command("invokeMethod") and pass a parameter.

For example:

<forEach items="${vm.indexes}">
    
<button label="Button ${each}" onClick="@command('invokeMethod', param=each)"/>

</forEach>

Thanks

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Kevin Lin