Grails tagLib each loop -


i'm trying index value on each loop around through taglib. example: rough dummy code.

        data.each() { item ->             def index out << "<option value='${item.name}'>item.name</option>"          } 

so data array of objects. i'm after trying index of each item in each loop.

this easy accomplish using eachwithindex

data.eachwithindex { item, idx ->   out << "<option value='${item.name}'>${item.name}  - ${idx}</option>" } 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -