Finally custom widget from code looks to be working.

Followed again this: http://dojotoolkit.org/documentation/tutorials/1.8/recipes/custom_widget/
ListItem widget working.

Problem was there's no this context inside _lang/array's forEach.
Added this context to baseArray.forEach -missing before.
Also added ListItem.addResource(res)
ListItem has a URL of the branch represented.