This is an example where you can create your tabs and layers dynamically. Then move from one tab to another which displays the associated layer.
Generally in the web we can find how to dynamically move from one tab to another, but not how to dynamically create tabs and layers . I had to do this for one of my project and therefore thought to add this for reference.
The code is pretty simple and it has been arraged properly for reuse and customization. Click here to see the working version and get the code .For more questions u can email me to firstname.lastname@example.org
Thanks, Please drop by your comments.