access spring model attribute in javascript with variable -


i added attribute 'workplacegroups' spring model, list. later try accsess on 1 object in list given index. access works if .get(0) use variable int .get(i)but error.

can tell me why got error or how can use variable int i? answers.

<script th:inline="javascript">     function printtest(i){                 var test = [[${workplacegroups.get(0).getid()}]]; //works          var test2 = [[${workplacegroups.get(i).getid()}]]; //doesn't work      } </script> 


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -